/* VeraAI web: preserve the App's dark, lime, violet palette and badge. */
:root {
  --bg: #0e1117; --panel: #171b22; --panel2: #1e232c; --line: rgba(255,255,255,.14);
  --ink: #f2f4f7; --sub: #aab2bf; --mute: #a0a8b5;
  --lime: #d6f35c; --lime-ink: #1a1f0a; --violet-top: #a49be0; --violet-bottom: #5e5793;
  --card: #fbfcf9; --hero-ink: #13170a; --card-sub: #535a45; --alert: #f08fa6; --alert-on-card: #a52142;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; min-height: 100svh; font-size: 16px; line-height: 1.6; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button, .link, nav a, summary { touch-action: manipulation; }
button { min-height: 44px; cursor: pointer; border: 0; border-radius: 999px; padding: 9px 18px; background: var(--lime); color: var(--lime-ink); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: var(--panel2); color: var(--ink); border: 1px solid var(--line); }
.link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; background: none; color: var(--sub); padding: 8px; font-weight: 400; }
button.link { border-radius: 10px; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
::selection { background: var(--lime); color: var(--lime-ink); }
input, textarea { caret-color: var(--lime); }
* { scrollbar-color: var(--mute) var(--panel); scrollbar-width: thin; }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(1.08); }
  .link:hover, .top nav a:not([aria-current="page"]):hover { color: var(--ink); background: var(--panel2); }
}
button:not(:disabled):active { filter: brightness(.94); }
.fine, .hint { color: var(--mute); font-size: 14px; }
.hint { display: block; line-height: 1.5; margin-top: 6px; }
.msg { min-height: 1.2em; margin: 10px 0; color: var(--alert); font-size: 14px; overflow-wrap: anywhere; }
.msg:empty { display: none; }
.msg.note { color: var(--sub); }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: space-between; margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.app-notice { padding: 14px max(16px, calc((100% - 1000px) / 2)); display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--panel2); color: var(--ink); overflow-wrap: anywhere; }
.app-notice span { min-width: 0; }
.app-notice button { flex-shrink: 0; }

/* Navigation stays available to touch, keyboard and pointer users. */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; order: 3; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--sub); padding: 8px 12px; border-radius: 999px; }
.top nav a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.logo { width: auto; height: 44px; border-radius: 12px; background: #f6f1e6; padding: 3px 8px; }
.me { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; margin-left: auto; color: var(--sub); }
.me img { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); object-fit: cover; }
#me-name { max-width: 12em; overflow-wrap: anywhere; }

/* Login keeps the existing lanyard, badge and character composition. */
.login { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: start; gap: 0; padding: 80px 16px 40px;
  background: radial-gradient(560px 560px at 60% 50%, rgba(214,243,92,.12), transparent 70%), var(--bg); }
.login .corner { position: absolute; left: 24px; top: 24px; }
.intro { order: 2; padding-top: 36px; width: 100%; max-width: 420px; }
.who { color: var(--lime); font-weight: 500; margin: 0 0 12px; font-size: 14px; }
.intro h1 { font-size: clamp(34px, 4vw, 46px); line-height: 1.25; margin: 0 0 14px; text-wrap: balance; }
.lead { color: var(--sub); margin: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.intro .fine { margin-top: 28px; }
.hang { order: 1; width: 100%; max-width: 400px; min-width: 0; display: flex; flex-direction: column; align-items: center; animation: hang .7s cubic-bezier(.16,1,.3,1) both; }
@keyframes hang { from { transform: translateY(-20px); } to { transform: none; } }
.lanyard { width: 150px; height: 56px; }
.lanyard path { stroke: var(--violet-top); stroke-width: 12; fill: none; }
.clip { width: 58px; height: 16px; border-radius: 5px; background: var(--sub); position: relative; z-index: 1; }
.clip::after { content: ""; position: absolute; inset: 5px 12px; border-radius: 3px; background: var(--bg); }
.badge { width: 100%; margin-top: -6px; background: var(--card); color: var(--hero-ink); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); color-scheme: light; }
.badge-head { display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 10px 22px; background: var(--lime); color: var(--lime-ink); }
.badge-head b { font-size: 17px; }
.badge-head span { font-weight: 600; }
.badge-body { padding: 20px; }
.auth-switch { display: flex; gap: 8px; margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid #d5d9cb; }
.auth-switch button { flex: 1; padding-inline: 8px; background: transparent; color: var(--card-sub); }
.auth-switch button[aria-pressed="true"] { background: var(--hero-ink); color: var(--card); }
.fields { display: grid; gap: 16px; }
.field { min-width: 0; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.password-field { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.password-field input { border: 0; background: transparent; border-radius: 12px; flex: 1; min-width: 0; }
.password-field .password-toggle { flex: 0 0 auto; color: var(--sub); background: transparent; border-radius: 10px; padding-inline: 12px; font-size: 14px; }
.badge input { background: #fff; color: var(--hero-ink); border-color: #a8ae9a; caret-color: var(--hero-ink); }
.badge .password-field { background: #fff; border-color: #a8ae9a; }
.badge .password-toggle { color: var(--card-sub); }
.badge .hint, .auth-note { color: var(--card-sub); }
.badge button:focus-visible, .badge input:focus-visible { outline-color: var(--hero-ink); }
.badge .msg { color: var(--alert-on-card); }
.badge .msg.note { color: var(--card-sub); }
.auth-submit { width: 100%; margin-top: 2px; }
.auth-note { font-size: 14px; margin: 18px 0 0; }
.vera { display: none; }

/* Signed-in content uses the same layout on every device. */
.work { width: 100%; max-width: 860px; margin: 20px auto; padding: 0 16px; display: grid; gap: 16px; }
.account-work { max-width: 580px; }
.admin-work { max-width: 1120px; }
.center { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; overflow-wrap: anywhere; }
.card.narrow { width: 100%; max-width: 500px; }
.card h1, .card h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.4; }
.card.narrow .logo { margin-bottom: 24px; }
.ask-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ask-head h1, .ask-head h2 { margin: 0; }
.pill { font-size: 14px; padding: 6px 12px; border-radius: 12px; background: var(--panel2); color: var(--sub); }
.pill.on { background: rgba(214,243,92,.14); color: var(--lime); }
textarea, input { min-width: 0; width: 100%; min-height: 44px; background: var(--panel2); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px; }
textarea { display: block; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--sub); opacity: 1; }
.layers { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.layers li { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--panel2); color: var(--mute); }
.layers li.running { color: var(--ink); outline: 1px solid var(--lime); }
.layers li.done { color: var(--lime-ink); background: var(--lime); }
.quick { background: var(--panel2); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.quick small { color: var(--lime); }
.quick p { margin: 4px 0 0; }
.answer, .body, .quick, .list, .table { overflow-wrap: anywhere; }
.answer p, .body p { margin: 0 0 .8em; white-space: pre-wrap; }
.answer p:last-child, .body p:last-child { margin-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { min-width: 0; background: var(--panel2); border-radius: 14px; padding: 12px 14px; }
.list .history-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px; }
.history-item details { flex: 1; min-width: 0; }
.history-item summary { min-height: 44px; padding: 8px 6px; color: var(--ink); }
.history-question { overflow-wrap: anywhere; }
.history-meta { display: block; margin-top: 4px; font-size: 14px; color: var(--sub); }
.pick { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; cursor: pointer; }
.pick input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--lime); }
.list .body { margin-top: 8px; padding: 8px 6px; }
.list.small li { font-size: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.table th, .table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mute); font-weight: 500; }
.table th:first-child { width: 21%; }
.table th:nth-child(2), .table th:nth-child(3) { width: 10%; }
.table th:nth-child(4) { width: 7%; }
.table th:nth-child(5) { width: 17%; }
.table td button { padding: 8px 12px; font-size: 14px; }
.table td input { max-width: 100px; padding: 8px; }
.table .account-name { display: block; font-size: 16px; }
.table .account-username { display: block; color: var(--sub); margin-top: 4px; }
.account-actions, .quota-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.tag { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--panel2); }
.tag.active { color: var(--lime); } .tag.pending { color: var(--violet-top); } .tag.disabled, .tag.flagged { color: var(--alert); }
details summary { cursor: pointer; min-height: 44px; color: var(--sub); padding-block: 10px; }
#setup-details { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 8px; }
#setup-details summary { overflow-wrap: anywhere; }
#setup-details .fine { margin: 0 0 14px; }

@media (max-width: 779px) {
  .table, .table tbody { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 8px; border: 0; padding: 7px 0; }
  .table td::before { content: attr(data-label); color: var(--sub); font-size: 14px; }
  .table td > * { min-width: 0; }
  .table .cell-value { min-width: 0; }
  .table .empty-cell { display: block; }
  .table .empty-cell::before { content: none; }
}
@media (max-width: 479px) {
  .me { flex: 1 0 100%; margin-left: 0; }
  #me-name { flex: 1; max-width: none; }
  .top nav { gap: 2px; }
  .top nav a { padding-inline: 10px; }
  .card { padding: 16px; }
  .badge-body { padding: 18px 16px; }
  .app-notice { flex-wrap: wrap; }
}
@media (min-width: 780px) {
  .top { padding: 16px 24px; }
  .top nav { flex: 1; flex-basis: auto; order: 0; }
  .work { margin-top: 28px; }
  .card { padding: 24px; }
}
@media (min-width: 1080px) {
  .login { grid-template-columns: minmax(280px, 350px) minmax(360px, 400px) minmax(160px, 260px); justify-content: center; justify-items: stretch; gap: 32px; padding: 0 40px 30px; }
  .login .corner { left: 40px; top: 30px; }
  .intro { order: 0; align-self: center; padding-top: 100px; }
  .hang { order: 0; }
  .lanyard { height: 110px; }
  .vera { display: block; align-self: end; width: 100%; margin-bottom: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .hang { animation: none; } }
