:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #68726e;
  --paper: #f6f5ef;
  --surface: #fffef9;
  --line: #dfe3dc;
  --pine: #0d4035;
  --pine-2: #176553;
  --lime: #d9f36b;
  --lime-soft: #eff8c9;
  --red: #c43d35;
  --red-soft: #fdeae7;
  --shadow: 0 18px 60px rgba(20, 46, 38, .09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 18px; letter-spacing: -.03em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--pine); color: var(--lime); font-size: 18px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
.login-panel { padding: 52px clamp(36px, 7vw, 112px); display: flex; flex-direction: column; justify-content: space-between; background: var(--pine); color: white; position: relative; overflow: hidden; }
.login-panel::after { content: ""; position: absolute; width: 520px; height: 520px; right: -210px; bottom: -250px; border: 1px solid rgba(217,243,107,.25); border-radius: 50%; box-shadow: 0 0 0 70px rgba(217,243,107,.035), 0 0 0 140px rgba(217,243,107,.025); pointer-events: none; }
.login-panel .brand { color: white; }
.login-panel .brand-mark { background: var(--lime); color: var(--pine); }
.login-panel .brand small, .login-panel .muted { color: rgba(255,255,255,.62); }
.login-copy { position: relative; z-index: 1; max-width: 650px; margin: 80px 0; }
.eyebrow, .step-label, .page-kicker { margin: 0 0 12px; color: var(--pine-2); font-weight: 750; font-size: 11px; letter-spacing: .14em; }
.login-panel .eyebrow { color: var(--lime); }
.login-copy h1 { margin: 0; max-width: 690px; font-size: clamp(46px, 6vw, 82px); line-height: .98; letter-spacing: -.065em; font-weight: 670; }
.login-copy p { max-width: 610px; margin: 30px 0 0; color: rgba(255,255,255,.68); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.7; }
.trust-row { display: flex; gap: 22px; color: rgba(255,255,255,.62); font-size: 12px; letter-spacing: .04em; }
.trust-row span::before { content: "✓"; color: var(--lime); margin-right: 7px; }
.signin-card { width: min(440px, calc(100% - 48px)); margin: auto; padding: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); display: grid; gap: 26px; }
.signin-card h2, .panel h2, .section-intro h2, dialog h2 { margin: 0; letter-spacing: -.035em; font-size: 27px; }
.signin-card .muted { line-height: 1.65; }
.muted { color: var(--muted); }
.google-button { min-height: 44px; display: grid; place-items: center; }
.form-message { min-height: 20px; margin: -12px 0 0; color: var(--red); font-size: 13px; line-height: 1.45; text-align: center; }
details { border-top: 1px solid var(--line); padding-top: 18px; }
summary { cursor: pointer; color: var(--pine-2); font-size: 13px; font-weight: 700; }
.signin-foot { padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #43a276; box-shadow: 0 0 0 4px rgba(67,162,118,.11); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { background: var(--pine); color: white; padding: 28px 18px 22px; position: fixed; inset: 0 auto 0 0; width: 245px; display: flex; flex-direction: column; z-index: 5; }
.sidebar-brand { color: white; padding: 0 10px 30px; }
.sidebar-brand .brand-mark { background: var(--lime); color: var(--pine); }
.sidebar-brand small { color: rgba(255,255,255,.55); }
.main-nav { display: grid; gap: 7px; }
.sidebar-links { margin: 22px 9px 0; padding-top: 18px; display: grid; gap: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-links a { display: flex; justify-content: space-between; color: rgba(255,255,255,.58); text-decoration: none; font-size: 11px; font-weight: 650; }
.sidebar-links a:hover { color: var(--lime); }
.nav-item { border: 0; background: transparent; color: rgba(255,255,255,.65); border-radius: 11px; padding: 12px 13px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font-weight: 620; }
.nav-item span { width: 22px; text-align: center; font-size: 17px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: var(--lime); color: var(--pine); }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 20px 8px 0; }
.org-chip { display: flex; align-items: center; gap: 11px; min-width: 0; }
.org-chip > span { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: var(--pine); background: var(--lime-soft); font-weight: 800; }
.org-chip div { min-width: 0; display: grid; }
.org-chip strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.org-chip small { margin-top: 3px; color: rgba(255,255,255,.55); text-transform: capitalize; }
.text-button { border: 0; background: none; padding: 16px 0 0; color: rgba(255,255,255,.56); cursor: pointer; font-size: 12px; }
.text-button:hover { color: white; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { min-height: 105px; padding: 25px clamp(24px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246,245,239,.9); position: sticky; top: 0; z-index: 4; backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.page-kicker { margin-bottom: 5px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 14px; }
.live-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; }
.live-pill i { width: 7px; height: 7px; background: #3e9b70; border-radius: 50%; }
.avatar-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink); color: white; font-weight: 750; }
.content { max-width: 1320px; margin: 0 auto; padding: 42px clamp(24px, 4vw, 58px) 70px; }
.view { display: none; }
.view.active { display: block; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel, .table-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(25,45,39,.035); }
.metric-card { padding: 24px; min-height: 176px; }
.balance-card { background: var(--pine); border-color: var(--pine); color: white; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 650; }
.balance-card .metric-head, .balance-card p { color: rgba(255,255,255,.62); }
.metric-card > strong { display: block; margin-top: 25px; font-size: clamp(29px, 3vw, 40px); letter-spacing: -.055em; }
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.card-icon { width: 28px; height: 28px; border: 1px solid currentColor; border-radius: 8px; display: grid; place-items: center; opacity: .7; }
.trend { border-radius: 999px; padding: 4px 7px; font-size: 9px; letter-spacing: .08em; }
.trend.positive { color: #216b4d; background: #dff3e8; }
.inline-link { border: 0; background: none; padding: 0; color: var(--pine-2); font-size: 12px; font-weight: 750; cursor: pointer; }
.balance-card .inline-link { color: var(--lime); margin-top: 17px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 16px; margin-top: 16px; }
.panel { padding: 26px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { font-size: 21px; }
.quickstart-panel pre { margin: 22px 0 0; padding: 19px; background: #13231f; color: #d8efe5; border-radius: 13px; overflow: auto; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.steps { list-style: none; margin: 27px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 10px; }
.steps li > span { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: var(--lime-soft); color: var(--pine); font-size: 11px; font-weight: 800; }
.steps div { display: grid; gap: 6px; }
.steps strong { font-size: 12px; }
.steps small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.secondary-button, .primary-button, .danger-button { border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: 12px; }
.secondary-button { background: transparent; border: 1px solid var(--line); }
.secondary-button:hover { background: #f0f1ec; }
.primary-button { border: 1px solid var(--pine); background: var(--pine); color: white; }
.primary-button:hover { background: var(--pine-2); }
.danger-button { border: 1px solid #efc8c5; color: var(--red); background: var(--red-soft); }
.empty-state { color: var(--muted); text-align: center; padding: 50px 20px; font-size: 13px; }
.key-summary-list { display: grid; gap: 9px; margin-top: 22px; }
.key-row { padding: 12px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.key-row div { display: grid; gap: 3px; min-width: 0; }
.key-row strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.key-row code { color: var(--muted); font-size: 10px; }
.status-badge { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-badge.active { color: #176342; background: #dcf2e5; }
.status-badge.neutral { color: var(--muted); background: #eff0eb; }
.status-badge.pending { color: #805b08; background: #fff0c9; }

.section-intro { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.section-intro h2 { font-size: 31px; }
.section-intro p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.form-panel { margin-bottom: 16px; }
.form-panel:not(.always-visible) { border-left: 4px solid var(--lime); }
.form-grid { display: grid; grid-template-columns: 1.3fr .7fr .9fr; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
input, select { width: 100%; min-height: 43px; border: 1px solid #cfd5ce; border-radius: 10px; padding: 9px 12px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--pine-2); box-shadow: 0 0 0 3px rgba(23,101,83,.11); }
.form-actions { margin-top: 19px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.table-panel { overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #faf9f4; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td code { padding: 4px 7px; border-radius: 6px; background: #f0f1ec; }
.table-action { border: 0; background: none; color: var(--red); cursor: pointer; font-weight: 700; }
.large-balance { display: grid; text-align: right; }
.large-balance small { color: var(--muted); }
.large-balance strong { margin-top: 4px; font-size: 25px; }
.billing-grid, .integration-grid { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: start; }
.amount-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 24px 0 18px; }
.amount-options button { border: 1px solid var(--line); background: white; padding: 13px 8px; border-radius: 10px; cursor: pointer; font-weight: 750; }
.amount-options button.selected { border-color: var(--pine); background: var(--lime-soft); }
.always-visible label + label { margin-top: 16px; }
.full-button { width: 100%; margin-top: 20px; }
.form-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.order-list { padding: 10px 0 0; text-align: left; }
.order-item { padding: 14px 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.order-item:last-child { border-bottom: 0; }
.order-item div { display: grid; gap: 4px; }
.order-item small { color: var(--muted); }
.provider-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.provider-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--pine); color: var(--lime); font-weight: 850; }
.provider-card h3 { margin: 0; font-size: 16px; }
.provider-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

dialog { border: 0; padding: 0; border-radius: 22px; color: var(--ink); box-shadow: var(--shadow); width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(9,27,22,.55); backdrop-filter: blur(4px); }
.dialog-card { padding: 32px; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.secret-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-radius: 12px; background: #eff1eb; }
.secret-box code { padding: 7px; overflow-wrap: anywhere; font-size: 12px; }
.secret-box button { border: 0; border-radius: 8px; background: white; padding: 8px 12px; cursor: pointer; }
.toast { position: fixed; right: 24px; bottom: 24px; transform: translateY(120px); opacity: 0; transition: .25s ease; z-index: 20; padding: 13px 17px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .balance-card { grid-column: 1 / -1; }
  .dashboard-grid, .billing-grid, .integration-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-panel { min-height: 48vh; padding: 35px 38px; }
  .login-copy { margin: 65px 0 35px; }
  .login-copy h1 { font-size: clamp(42px, 9vw, 66px); }
  .signin-card { margin: 45px auto; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { min-height: 100vh; }
  .topbar { min-height: 82px; padding: 17px 18px; }
  .top-actions .live-pill { display: none; }
  .content { padding: 25px 16px 95px; }
  .metric-grid { grid-template-columns: 1fr; }
  .balance-card { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .large-balance { text-align: left; }
  .table-panel { overflow-x: auto; }
  table { min-width: 700px; }
  .mobile-nav { position: fixed; z-index: 8; inset: auto 0 0; height: 68px; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,254,249,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav button, .mobile-nav a { border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; display: grid; place-items: center; }
  .mobile-nav button.active { color: var(--pine); box-shadow: inset 0 3px var(--lime); }
  .login-panel { min-height: auto; padding: 28px 24px 42px; }
  .login-copy { margin: 48px 0 18px; }
  .login-copy h1 { font-size: 40px; }
  .login-copy p { font-size: 15px; }
  .trust-row { display: none; }
  .signin-card { width: calc(100% - 28px); margin: 18px auto 35px; padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
