:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1e293b;
  background: #f4f7fb;
  font-synthesis: none;
  line-height: 1.6;
  --accent: #015ca7;
  --accent-soft: #e8f1fa;
  --muted: #64748b;
  --line: #dbe4ee;
  --shadow: 0 12px 36px rgba(30, 41, 59, .06);
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(160deg, #f4f7fb, #e6edf5); min-height: 100vh; }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; top: -80px; inset-inline-start: 16px; z-index: 10; padding: 12px 20px; background: white; border-radius: 12px; }
.skip-link:focus { top: 12px; }
.shell { max-width: 1180px; margin: auto; padding: 0 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 100px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.language-select { max-width: 150px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: inherit; }
.brand { display: flex; align-items: center; gap: 14px; color: #1e293b; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: .08em; line-height: 1.3; }
.brand strong { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .03em; margin-top: 4px; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; letter-spacing: -.9px; margin: 10px 0 14px; font-weight: 750; overflow-wrap: anywhere; }
h2 { font-size: 21px; margin: 0 0 14px; line-height: 1.35; letter-spacing: -.4px; }
h3 { margin: 0; font-size: 16px; }
p { margin: 10px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 750; color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.hero { padding: 34px 0 12px; }
.hero p { color: var(--muted); max-width: 600px; font-size: 15px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 28px; margin: 20px 0; box-shadow: var(--shadow); min-width: 0; }
.auth-layout { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 64px; min-height: 650px; padding: 44px 0; }
.auth-intro { max-width: 500px; }
.auth-intro h2 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -1.4px; margin: 14px 0 20px; }
.intro-copy { color: var(--muted); font-size: 17px; max-width: 440px; }
.feature-list { display: grid; gap: 24px; margin: 32px 0; }
.feature { display: flex; align-items: flex-start; gap: 16px; }
.feature > .icon { box-sizing: content-box; padding: 12px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); }
.feature p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.auth { width: 100%; max-width: 460px; margin: 0; padding: 36px; }
.auth h1 { font-size: 30px; }
.auth .button { width: 100%; margin-top: 12px; }
.auth .actions { margin-top: 0; }
.auth .text-button { display: block; margin: 14px auto 0; }
.field { display: flex; flex-direction: column; gap: 7px; margin: 18px 0; font-size: 12px; font-weight: 650; min-width: 0; }
.field input, .field select { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; min-height: 46px; color: #1e293b; width: 100%; min-width: 0; font-weight: 400; }
.field input:focus, .field select:focus { border-color: var(--accent); background: white; }
.button { background: var(--accent); color: white; border: 1px solid var(--accent); border-radius: 12px; padding: 11px 18px; min-height: 44px; font-size: 13px; font-weight: 650; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button:hover:not(:disabled) { background: #004d8e; }
.button.secondary { color: var(--accent); background: white; border-color: #cbd9e8; }
.button.secondary:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.button.compact { font-size: 12px; padding: 7px 12px; min-height: 40px; }
.text-button { background: none; border: 0; padding: 10px 6px; color: var(--accent); font-size: 12px; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.nav { display: flex; gap: 10px; border-bottom: 1px solid var(--line); margin: 12px 0 24px; padding-bottom: 14px; }
.nav button { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 12px; padding: 12px 20px; min-height: 48px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.nav button:hover { background: white; }
.nav button[aria-current="page"] { color: var(--accent); border-color: #cbd9e8; background: white; box-shadow: 0 3px 12px rgba(30, 41, 59, .04); }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.overview-card { display: flex; align-items: flex-start; gap: 16px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.overview-card > .icon { box-sizing: content-box; padding: 11px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.overview-card strong { display: block; font-size: 28px; letter-spacing: -.6px; line-height: 1.3; margin: 4px 0; }
.overview-card .muted { display: block; font-size: 12px; }
.section-heading { margin: 30px 0 20px; }
.section-heading h2 { margin-bottom: 4px; }
.section-heading p { margin: 0; }
.tools { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 220px)); gap: 14px; align-items: end; margin-bottom: 20px; }
.tools .field { margin: 0; }
.wallets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wallet { display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 22px; padding: 26px; gap: 9px; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.wallet-head { display: flex; align-items: center; gap: 12px; }
.wallet-head .text-button { margin-inline-start: auto; }
.monogram { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #cbd9e8; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 19px; flex-shrink: 0; }
.tier { border: 1px solid #cbd9e8; background: #f5f8fc; color: #475569; border-radius: 30px; font-size: 11px; padding: 4px 12px; }
.wallet h2 { margin: 6px 0 0; }
.balance-label { color: var(--muted); font-size: 12px; margin-top: 10px; }
.amount { color: var(--accent); font-size: 32px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.amount small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-inline-start: 7px; }
.wallet .button { margin-top: auto; width: 100%; }
.meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 20px; background: #e9eef5; overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.wallet > .muted { margin: 4px 0 16px; font-size: 12px; }
.notice { border-inline-start: 3px solid #d97706; background: #fffbeb; padding: 14px 16px; border-radius: 10px; font-size: 13px; margin: 16px 0; overflow-wrap: anywhere; }
.status { border: 1px solid #fecaca; background: #fef2f2; padding: 14px 18px; border-radius: 12px; color: #991b1b; white-space: pre-wrap; overflow-wrap: anywhere; margin: 20px 0; }
.table-scroll { overflow: auto; margin-top: 20px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: start; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; background: #f8fafc; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); }
td:nth-last-child(-n+2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.positive { color: #166534; }
td.negative { color: #b91c1c; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.empty { padding: 44px 24px; text-align: center; border: 1px dashed #bacbdf; border-radius: 20px; background: rgba(255, 255, 255, .65); color: var(--muted); grid-column: 1 / -1; font-size: 14px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 14px; margin: 20px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.rule { padding: 16px; background: #f5f8fc; border: 1px solid #e7edf5; border-radius: 14px; font-size: 13px; overflow-wrap: anywhere; }
.rule strong { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.rules > p { grid-column: 1 / -1; }
summary { cursor: pointer; padding: 8px 0; color: var(--accent); font-size: 14px; font-weight: 600; }
footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 22px 0; margin-top: 48px; color: var(--muted); font-size: 11px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
footer strong { color: var(--accent); }
@media (max-width: 900px) {
  .auth-layout { gap: 32px; min-height: 600px; }
  .auth { padding: 26px; }
  .overview-card { padding: 16px; gap: 10px; }
  .overview-card > .icon { padding: 8px; width: 20px; height: 20px; }
  .tools { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 170px)); }
}
@media (max-width: 600px) {
  .shell { padding: 0 18px; }
  .topbar { min-height: 82px; }
  .brand { font-size: 18px; gap: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand strong { font-size: 10px; }
  .hero { padding-top: 26px; }
  .auth-layout { grid-template-columns: 1fr; gap: 26px; padding: 28px 0 0; min-height: auto; }
  .auth-intro { order: 2; padding: 10px 4px; }
  .auth-intro h2 { font-size: 30px; }
  .intro-copy { font-size: 14px; }
  .feature-list { gap: 20px; margin: 24px 0; }
  .auth { max-width: none; padding: 24px; }
  .wallets { grid-template-columns: 1fr; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .overview-card { flex-direction: column; padding: 16px; gap: 8px; }
  .overview-card:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
  .overview-card:last-child strong { font-size: 18px; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tools .field:first-child { grid-column: 1 / -1; }
  .panel { padding: 22px 18px; }
  .nav { gap: 6px; }
  .nav button { flex: 1; flex-direction: column; padding: 10px 6px; gap: 4px; font-size: 12px; }
  .nav .icon { width: 20px; height: 20px; }
  .wallet { padding: 22px; }
  .rules { grid-template-columns: 1fr; }
  th, td { padding: 12px 8px; }
  footer { flex-wrap: wrap; margin-top: 32px; }
}
.field textarea { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; color: #1e293b; width: 100%; min-width: 0; font: inherit; font-weight: 400; resize: vertical; box-sizing: border-box; }
.field textarea:focus { border-color: var(--accent); background: white; }
.nav button { position: relative; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; flex-shrink: 0; }
.badge { display: inline-block; border-radius: 30px; font-size: 11px; font-weight: 650; padding: 3px 10px; border: 1px solid #cbd9e8; background: #f5f8fc; color: #475569; }
.badge-open { background: var(--accent-soft); color: var(--accent); }
.badge-awaiting_member { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.badge-resolved { background: #ecfdf5; border-color: #86efac; color: #166534; }
.request-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.request-item { width: 100%; text-align: start; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: white; color: inherit; font: inherit; overflow-wrap: anywhere; }
.request-item:hover { border-color: var(--accent); }
.request-title { display: flex; align-items: center; gap: 8px; }
.request-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thread { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.message { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; max-width: 85%; overflow-wrap: anywhere; }
.message-member { justify-self: end; background: var(--accent-soft); border-color: #cbd9e8; }
.message-staff { justify-self: start; background: white; }
.message-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.message-body { white-space: pre-wrap; margin: 8px 0 0; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .button, .nav button { transition: background .15s ease, border-color .15s ease; }
  .wallet { animation: appear .25s ease-out; }
  @keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
.brand-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 15px; border: 1px solid var(--line); background: white; flex-shrink: 0; }
.brand-logo.large, .monogram.large { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.auth-brand { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 18px; border-radius: 16px; background: var(--accent-soft); border: 1px solid #cbd9e8; overflow-wrap: anywhere; }
.auth-brand strong { display: block; font-size: 15px; }
.auth-brand .muted { display: block; font-size: 12px; }
.brand-banner { display: flex; align-items: center; gap: 20px; margin: 28px 0 8px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.brand-copy { flex: 1; min-width: 0; }
.brand-copy h2 { margin: 2px 0 0; font-size: 24px; }
.brand-copy p { margin: 6px 0 0; white-space: pre-line; }
.brand-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: end; }
.brand-balance .amount { font-size: 26px; }
body.focus-mode footer { display: none; }
body.focus-mode .topbar { min-height: 64px; }
.join-layout { display: flex; justify-content: center; padding: 16px 0; }
.join-card { display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100dvh - 100px); background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.join-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(160deg, white, var(--accent-soft)); overflow-wrap: anywhere; }
.join-head h1 { font-size: 24px; margin: 2px 0 0; letter-spacing: -.5px; }
.join-description { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.join-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px; overscroll-behavior: contain; }
.join-body > .muted { margin: 10px 0; }
.join-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.join-rules div { padding: 9px 11px; background: #f5f8fc; border: 1px solid #e7edf5; border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.join-rules dt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.join-rules dd { margin: 2px 0 0; font-size: 13px; line-height: 1.35; font-weight: 600; }
.join-body details { margin: 6px 0 0; }
.join-body .check { margin: 10px 0; font-size: 13px; }
.notice.compact { margin: 10px 0 0; padding: 8px 12px; font-size: 12px; }
.join-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; }
.join-actions .muted { grid-column: 1 / -1; margin: 0; font-size: 11px; text-align: center; }
.join-actions.single { grid-template-columns: 1fr; }
.link-brand { display: block; font-size: 20px; letter-spacing: -.3px; }
.link-body { padding: 18px 22px; text-align: center; }
.link-body h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.5px; }
.link-body p { margin: 8px 0; }
.link-success { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; background: #e7f7ee; color: #15803d; }
.link-reward { color: #15803d; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; animation: link-pop .5s ease-out both; }
@keyframes link-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .link-reward { animation: none; } }
@media (max-width: 600px) {
  body.focus-mode .topbar { min-height: 56px; }
  body.focus-mode .brand-mark { width: 32px; height: 32px; }
  .join-layout { padding: 8px 0 0; }
  .join-card { max-height: calc(100dvh - 72px); border-radius: 18px; }
  .join-head { padding: 14px 16px 10px; gap: 12px; }
  .join-head h1 { font-size: 20px; }
  .join-head .brand-logo.large, .join-head .monogram.large { width: 52px; height: 52px; }
  .join-body { padding: 2px 16px; }
  .join-rules { gap: 6px; }
  .join-rules div { padding: 7px 9px; }
  .join-rules dd { font-size: 12px; }
  .join-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .brand-banner { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .brand-balance { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; text-align: start; }
}
.topbar-actions .button { white-space: nowrap; }
