/* Graite's look, taken from the website (graite-frontend/src/styles/global.css). The pages
   follow the system light/dark setting. No inline styles: the CSP only allows this file. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/static/fonts/newsreader-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --bg: #faf9f6; --surface: #fff; --surface-2: #f1f0eb; --fg: #282824; --muted: #73736b;
  --border: #e4e3db; --accent: #6e7861; --accent-soft: #edf0e8;
  --add-bg: #edf5ee; --add-fg: #3c7551; --del-bg: #fbefed; --del-fg: #a36b65;
  --shadow: 0 2px 4px rgb(45 43 33 / .02), 0 16px 45px -18px rgb(45 43 33 / .15);
  --sans: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader Variable", ui-serif, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c19; --surface: #23241f; --surface-2: #2a2c25; --fg: #eeeee5; --muted: #aaa99d;
    --border: #393b32; --accent: #b0bba0; --accent-soft: #30362a;
    --add-bg: #24362a; --add-fg: #aad0b4; --del-bg: #392a28; --del-fg: #d5a39c;
    --shadow: 0 2px 4px rgb(0 0 0 / .1), 0 16px 45px -18px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 0 16px; background: var(--bg); color: var(--fg);
  font: 15px/1.6 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--border);
    text-underline-offset: 4px; }
a:hover { text-decoration-color: currentColor; }

/* Header, card, footer */
.site-header { display: flex; justify-content: center; padding: 48px 0 28px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 550;
         letter-spacing: -.065em; text-decoration: none; }
.logo { width: 28px; height: 28px; flex-shrink: 0; }
.card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
        border-radius: 10px; padding: 32px; box-shadow: var(--shadow); }
.card.wide { max-width: 580px; }
.site-footer { padding: 28px 0 40px; font-size: 12px; color: var(--muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* Type */
h1 { font-family: var(--serif); font-weight: 450; font-size: 2rem; line-height: 1.1;
     letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: .055em; text-transform: uppercase;
     color: var(--accent); margin: 32px 0 10px; }
p { margin: 0 0 12px; }
strong { font-weight: 600; }
.hint, .alt { color: var(--muted); font-size: 13px; }
.alt { margin: 18px 0 0; }
p.error, p.notice { padding: 10px 12px; border-radius: 7px; font-size: 14px; }
p.error { background: var(--del-bg); color: var(--del-fg); }
p.notice { background: var(--add-bg); color: var(--add-fg); }
span.error { color: var(--del-fg); }

/* Forms */
form { margin: 0; }
label { display: block; margin: 16px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
input { display: block; width: 100%; height: 44px; margin-top: 6px; padding: 0 12px; font: inherit;
        color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
        transition: border-color 150ms, box-shadow 150ms; }
input:focus { outline: none; border-color: var(--accent);
              box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
form .hint { margin: 6px 0 0; }

/* Buttons (the website's .btn-primary / .btn-outline) */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  margin-top: 20px; padding: 0 20px; font: inherit; font-size: 14px; font-weight: 550;
  border: 1px solid var(--fg); border-radius: 7px; cursor: pointer; text-decoration: none;
  background: var(--fg); color: var(--bg); box-shadow: 0 2px 3px rgb(0 0 0 / .06);
  transition: background-color 160ms, transform 160ms;
}
button:hover, .button:hover { transform: translateY(-1px);
  background: color-mix(in srgb, var(--fg) 86%, var(--bg)); }
button.secondary { background: color-mix(in srgb, var(--surface) 60%, transparent);
                   color: var(--fg); border-color: var(--border); box-shadow: none; }
button.secondary:hover { background: var(--surface-2); }
button.destructive { background: var(--del-fg); border-color: var(--del-fg); color: var(--surface); }
button.link { display: inline; min-height: 0; margin: 0; padding: 0; border: 0; background: none;
              color: inherit; box-shadow: none; font-size: inherit; font-weight: 400;
              text-decoration: underline; text-underline-offset: 4px; }
button.link:hover { transform: none; background: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Account page */
table.usage { width: 100%; border-collapse: collapse; font-size: 13px; }
table.usage th { font-weight: 500; color: var(--muted); }
table.usage th, table.usage td { text-align: left; padding: 8px 4px;
                                 border-bottom: 1px solid var(--border); }
.meter { height: 6px; margin: 14px 0 6px; border-radius: 3px; background: var(--surface-2);
         overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); }
.p-5 > span { width: 5%; } .p-10 > span { width: 10%; } .p-15 > span { width: 15%; }
.p-20 > span { width: 20%; } .p-25 > span { width: 25%; } .p-30 > span { width: 30%; }
.p-35 > span { width: 35%; } .p-40 > span { width: 40%; } .p-45 > span { width: 45%; }
.p-50 > span { width: 50%; } .p-55 > span { width: 55%; } .p-60 > span { width: 60%; }
.p-65 > span { width: 65%; } .p-70 > span { width: 70%; } .p-75 > span { width: 75%; }
.p-80 > span { width: 80%; } .p-85 > span { width: 85%; } .p-90 > span { width: 90%; }
.p-95 > span { width: 95%; } .p-100 > span { width: 100%; background: var(--del-fg); }
ul.sessions { list-style: none; padding: 0; margin: 0; }
ul.sessions li { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                 padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
ul.sessions li button { margin: 0; min-height: 34px; padding: 0 12px; font-size: 13px; }
ul.sessions .hint { display: block; }
details.danger { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 16px; }
details.danger summary { cursor: pointer; color: var(--del-fg); font-size: 13px; }

@media (max-width: 480px) {
  .site-header { padding: 28px 0 20px; }
  .card { padding: 24px 20px; }
  h1 { font-size: 1.7rem; }
}
