/* Teal Account. One neutral scale, one radius family, one spacing rhythm (4/8).
   Colour is kept for meaning only: the logo, danger, and the data meter. */
@font-face { font-family: "Instrument Sans"; src: url("/font.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f5f6f6; --side: #ffffff; --panel: #ffffff; --raise: #f0f2f2;
  --line: #e3e6e5; --line-2: #d3d8d6;
  --ink: #141918; --ink-2: #4b5452; --ink-3: #616a68;
  --btn: #141918; --btn-ink: #ffffff; --btn-hover: #2a3130;
  --focus: #141918; --meter: #2f8f72; --danger: #c2372f; --danger-bg: #fbeceb;
  --shadow: 0 1px 2px rgba(20, 25, 24, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1112; --side: #121617; --panel: #161b1c; --raise: #1d2324;
    --line: #262d2e; --line-2: #343c3d;
    --ink: #eef1f0; --ink-2: #aab3b1; --ink-3: #7d8785;
    --btn: #eef1f0; --btn-ink: #0e1112; --btn-hover: #ffffff;
    --focus: #eef1f0; --meter: #5cc29f; --danger: #f0817a; --danger-bg: #2a1716;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1112; --side: #121617; --panel: #161b1c; --raise: #1d2324;
  --line: #262d2e; --line-2: #343c3d;
  --ink: #eef1f0; --ink-2: #aab3b1; --ink-3: #7d8785;
  --btn: #eef1f0; --btn-ink: #0e1112; --btn-hover: #ffffff;
  --focus: #eef1f0; --meter: #5cc29f; --danger: #f0817a; --danger-bg: #2a1716;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { display: block; }
i[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-primary[disabled] { opacity: .55; cursor: progress; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { background: var(--raise); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line-2); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-text { background: none; border: 0; padding: 8px 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--ink); }
.btn .g { width: 20px; height: 20px; }
.btn-apple { margin-top: 12px; }
input[type=email], input[type=text] { width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; }
input::placeholder { color: var(--ink-3); }
input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
input.code { font-size: 22px; letter-spacing: .35em; text-align: center; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link i[data-icon] { width: 16px; height: 16px; }
.err { color: var(--danger); min-height: 1.5em; margin-top: 12px; font-size: 14px; }

/* ---------- sign in */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 32px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 40px 32px 28px; box-shadow: var(--shadow); text-align: center; }
.auth-card h1 { font-size: 28px; margin-top: 36px; }
.auth-card .sub { color: var(--ink-2); margin: 10px 0 24px; }
.auth-card .sub a { font-weight: 600; text-underline-offset: 3px; }
.auth-card form { display: grid; gap: 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 20px 32px; color: var(--ink-2); font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.theme-btn { text-decoration: none; font-size: 13px; }

.lockup { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.lockup b { font-weight: 650; }
.lockup span { color: var(--ink-2); font-weight: 400; }
.lockup-center { justify-content: center; font-size: 22px; }

/* ---------- account shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 24px 16px; position: sticky; top: 0; height: 100vh; }
.side .lockup { padding: 0 8px 28px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--raise); color: var(--ink); }
.nav a.on { background: var(--raise); color: var(--ink); font-weight: 600; }
.nav hr { border: 0; height: 1px; background: var(--line); margin: 12px 8px; }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 40px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-title { font-size: 18px; flex: 1; }
.icon-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.user-btn:hover { background: var(--raise); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.user-email { font-size: 14px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; }
.menu button:hover { background: var(--raise); }

.content { padding: 40px; max-width: 1180px; }
section[data-view] { display: none; }
section[data-view].on { display: block; }
.hello { font-size: 32px; }
.lead { color: var(--ink-2); font-size: 16px; margin: 8px 0 32px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.col-side { display: grid; gap: 32px; padding-top: 4px; }
.tile h4 { font-size: 16px; margin-bottom: 6px; }
.tile p { margin-bottom: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h2 { font-size: 26px; margin-bottom: 4px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h4 { font-size: 16px; margin-bottom: 6px; }
.panel.narrow { max-width: 460px; }
.panel.narrow h2 { font-size: 22px; margin-bottom: 8px; }
.panel.narrow form { margin-top: 20px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.plan h3 { font-size: 26px; margin: 14px 0 6px; }
.meter { margin-top: 20px; }
.meter-track { height: 8px; border-radius: 999px; background: var(--raise); overflow: hidden; }
.meter-track span { display: block; height: 100%; width: 0; background: var(--meter); border-radius: 999px; }
.meter.full .meter-track span { background: var(--danger); }
.meter p { margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 36px 0 12px; }
.section-head h4 { font-size: 16px; }
.rows { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.rows li { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.rows .dev-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--raise); display: grid; place-items: center; color: var(--ink); flex: none; }
.rows .dev-ico i { width: 22px; height: 22px; }
.rows .dev-txt { flex: 1; min-width: 0; }
.rows .dev-txt b { display: block; font-weight: 600; }
.rows .dev-txt span { color: var(--ink-2); font-size: 14px; }
.rows .empty { justify-content: center; color: var(--ink-2); }
.rows .btn { height: 38px; padding: 0 16px; }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 4px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: var(--btn); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: var(--btn-ink); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 2px; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; color: var(--ink-3); background: var(--bg); }

/* ---------- small screens */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 20; transform: translateX(-100%); transition: transform .18s; visibility: hidden; }
  .shell.menu-open .side { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .icon-btn { display: inline-flex; }
  .top { padding: 0 16px; height: 64px; }
  .user-email { display: none; }
  .content { padding: 24px 16px 48px; }
  .hello { font-size: 26px; }
  .panel { padding: 22px 18px; }
  .danger-zone { flex-direction: column; align-items: stretch; }
  .auth-main { padding-top: 24px; }
  .auth-card { padding: 32px 20px 24px; border-radius: 14px; }
  .foot { padding: 16px; justify-content: center; }
  .rows li { padding: 14px 16px; }
}
