:root {
  --ink: #173f35;
  --ink-deep: #0d2f28;
  --ink-soft: #526b64;
  --paper: #f5f1e8;
  --paper-soft: #fbf8f1;
  --sage: #9caf9d;
  --sage-pale: #dce4d8;
  --brass: #c59a62;
  --brass-pale: #ead8be;
  --line: rgba(23, 63, 53, .14);
  --danger: #9e3f35;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); font-family: var(--sans);
  background:
    radial-gradient(circle at 6% 8%, rgba(156,175,157,.34), transparent 30rem),
    radial-gradient(circle at 92% 4%, rgba(197,154,98,.16), transparent 24rem), var(--paper);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
}
button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; position: relative; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 27px/1 var(--serif); }
.brand img { width: 31px; height: 29px; }
.brand-word { display: inline-block; }
.brand em { color: var(--brass); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.quiet-link, .pill-button { border: 0; background: transparent; text-decoration: none; cursor: pointer; font-size: 13px; font-weight: 700; }
.quiet-link { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.pill-button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); }
.pill-button:hover, .quiet-link:hover { border-color: var(--ink); }
.auth-layout { min-height: calc(100vh - 86px); display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: clamp(50px, 9vw, 130px); padding: 40px 0 90px; }
.auth-story { max-width: 480px; }
.eyebrow { margin: 0 0 20px; color: var(--brass); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow::before { content: "◆"; margin-right: 10px; font-size: 7px; }
h1, h2, h3, p { margin-top: 0; }
.auth-story h1, .page-heading h1 { margin-bottom: 25px; font: 500 clamp(50px, 6vw, 82px)/.96 var(--serif); letter-spacing: -3px; }
.auth-story h1 em { color: var(--brass); font-weight: 400; }
.auth-story > p { color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.promise-list { margin: 38px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.promise-list li { display: grid; grid-template-columns: 28px 1fr; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.promise-list strong { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(197,154,98,.55); border-radius: 50%; font: 600 12px var(--serif); }
.auth-card, .surface { position: relative; border: 1px solid rgba(23,63,53,.11); background: rgba(251,248,241,.88); box-shadow: 0 28px 80px rgba(27,51,43,.12); }
.auth-card { border-radius: 30px; padding: clamp(28px, 5vw, 48px); }
.auth-card > h2 { margin-bottom: 10px; font: 500 38px/1.08 var(--serif); }
.google-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 27px; border: 1px solid var(--line); border-radius: 17px; color: #4285f4; background: white; font: 700 24px Arial, sans-serif; box-shadow: 0 12px 28px rgba(23,63,53,.08); }
.google-button { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid rgba(23,63,53,.22); border-radius: 999px; color: var(--ink); background: white; cursor: pointer; font-weight: 800; box-shadow: 0 10px 24px rgba(23,63,53,.09); }
.google-button:hover { border-color: var(--ink); transform: translateY(-1px); }
.google-button:disabled { opacity: .6; cursor: wait; transform: none; }
.google-button svg { width: 21px; height: 21px; flex: 0 0 auto; }
.auth-assurance { margin: 22px 0; padding: 16px; border-radius: 14px; background: var(--sage-pale); }
.auth-assurance strong, .auth-assurance span { display: block; }
.auth-assurance strong { margin-bottom: 5px; font: 500 16px var(--serif); }
.auth-assurance span { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.auth-fine-print { margin: 18px 0 22px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; text-align: center; }
.secondary-link { display: block; text-align: center; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-underline-offset: 4px; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; margin-bottom: 35px; border-radius: 14px; background: var(--sage-pale); }
.auth-tab { min-height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 800; }
.auth-tab.active { color: white; background: var(--ink); box-shadow: 0 7px 18px rgba(23,63,53,.18); }
.form-panel h2 { margin-bottom: 8px; font: 500 34px/1.1 var(--serif); }
.form-intro { margin-bottom: 27px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.field input { width: 100%; min-height: 50px; padding: 0 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; outline: none; background: rgba(255,255,255,.53); }
.field input:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(197,154,98,.14); }
.field-note { display: block; margin-top: 6px; color: #71837c; font-size: 10px; line-height: 1.45; }
.primary { width: 100%; min-height: 51px; border: 0; border-radius: 999px; color: white; background: var(--ink); box-shadow: 0 12px 28px rgba(23,63,53,.2); cursor: pointer; font-weight: 800; }
.primary:hover { background: var(--ink-deep); transform: translateY(-1px); }
.primary:disabled { opacity: .6; cursor: wait; transform: none; }
.form-error { min-height: 18px; margin: 14px 0 0; color: var(--danger); font-size: 11px; line-height: 1.5; }
.recovery-choice { display: grid; gap: 10px; }
.choice-button { padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: transparent; cursor: pointer; }
.choice-button:hover { border-color: var(--brass); background: rgba(232,210,178,.14); }
.choice-button strong, .choice-button span { display: block; }
.choice-button strong { margin-bottom: 4px; font: 500 17px var(--serif); }
.choice-button span { color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.back-button { margin: 0 0 20px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.recovery-result { margin: 15px 0 0; padding: 14px; border-radius: 12px; background: var(--sage-pale); font-size: 12px; line-height: 1.5; }
.recovery-screen { text-align: center; }
.recovery-seal { width: 66px; height: 66px; margin: 0 auto 22px; display: grid; place-items: center; color: var(--ink); background: var(--brass-pale); border-radius: 50%; font: 500 25px var(--serif); }
.recovery-code { display: block; margin: 23px 0 13px; padding: 17px 10px; overflow-wrap: anywhere; border: 1px dashed var(--brass); border-radius: 13px; background: rgba(232,210,178,.18); font: 700 15px/1.5 ui-monospace, SFMono-Regular, monospace; letter-spacing: .04em; }
.recovery-warning { margin-bottom: 24px; color: var(--danger); font-size: 10px; line-height: 1.55; }
.secondary { width: 100%; min-height: 45px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 800; }

.page-main { padding: 55px 0 100px; }
.page-main, .auth-layout, .policy-page { flex: 1 0 auto; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 42px; }
.page-heading h1 { margin-bottom: 10px; font-size: clamp(46px, 6vw, 72px); }
.page-heading p { margin: 0; color: var(--ink-soft); }
.status-chip { padding: 10px 14px; border-radius: 999px; color: var(--ink); background: var(--sage-pale); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 28px; }
.metric { min-height: 126px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(251,248,241,.72); }
.metric strong { display: block; margin-bottom: 12px; font: 500 36px/1 var(--serif); }
.metric span { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 28px; align-items: start; }
.surface { padding: clamp(23px, 3vw, 34px); border-radius: 25px; }
.surface + .surface { margin-top: 24px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { margin-bottom: 5px; font: 500 27px var(--serif); }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.activity-list { display: grid; gap: 10px; }
.activity-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.activity-card:hover { transform: translateY(-2px); border-color: var(--brass); }
.activity-card h3 { margin: 0 0 5px; font: 500 18px var(--serif); }
.activity-card p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.activity-count { text-align: right; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.activity-count strong { display: block; margin-bottom: 4px; color: var(--ink); font: 500 18px var(--serif); }
.empty { padding: 27px; border: 1px dashed var(--line); border-radius: 15px; text-align: center; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.settings-form + .settings-form { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.settings-form h3 { font: 500 19px var(--serif); margin-bottom: 16px; }
.small-primary { min-height: 42px; padding: 0 17px; border: 0; border-radius: 999px; color: white; background: var(--ink); cursor: pointer; font-size: 11px; font-weight: 800; }
.sync-note { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.identity-card { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.42); }
.identity-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--ink); font: 500 18px var(--serif); }
.identity-card strong, .identity-card span { display: block; overflow-wrap: anywhere; }
.identity-card strong { margin-bottom: 4px; font: 500 17px var(--serif); }
.identity-card span { color: var(--ink-soft); font-size: 10px; }
.account-danger { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.account-danger strong { display: block; margin-bottom: 5px; font: 500 17px var(--serif); }
.account-danger p { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.policy-page { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 100px; }
.policy-page h1 { margin-bottom: 13px; font: 500 clamp(46px, 7vw, 72px)/1 var(--serif); letter-spacing: -2px; }
.policy-page h2 { margin: 35px 0 10px; font: 500 25px var(--serif); }
.policy-page p, .policy-page li { color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.policy-page ul { padding-left: 20px; }
.policy-updated { margin-bottom: 35px; color: var(--brass) !important; font-size: 10px !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.policy-link { margin: 25px 0 0; text-align: center; color: var(--ink-soft); font-size: 10px; }
.policy-link a { text-underline-offset: 4px; }
.admin-table-wrap { overflow-x: auto; }
.admin-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.custom-link-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(270px, 1.2fr) auto; gap: 14px; align-items: end; }
.custom-link-form label > span { display: block; margin-bottom: 8px; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.custom-link-form select, .custom-link-form input { width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.55); }
.slug-field { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.55); }
.slug-field > span { padding-left: 12px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.slug-field input { border: 0; border-radius: 0; background: transparent; }
.custom-links-list { display: grid; gap: 9px; margin-top: 22px; }
.custom-link-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.custom-link-card a, .custom-link-card span { display: block; }
.custom-link-card a { margin-bottom: 4px; font-weight: 800; text-underline-offset: 3px; }
.custom-link-card span { color: var(--ink-soft); font-size: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 0 12px 12px; text-align: left; color: var(--ink-soft); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
td { padding: 14px 12px; border-top: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
td strong { display: block; margin-bottom: 3px; font-size: 12px; }
.table-action { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.table-action.danger { color: var(--danger); border-color: rgba(158,63,53,.28); }
.loading { padding: 80px 0; text-align: center; color: var(--ink-soft); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px); padding: 13px 18px; border-radius: 999px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 11px; box-shadow: 0 15px 40px rgba(10,35,29,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.footer-brand { color: var(--ink); font: 600 18px var(--serif); }
.footer-brand em { color: var(--brass); font-weight: 400; }
.footer-copy { margin: 4px 0 0; }
.footer-links { display: flex; align-items: center; gap: 20px; }
.footer-links a { font-weight: 700; text-underline-offset: 4px; }
.mobile-tab-bar { display: none; }
@media (max-width: 800px) {
  .auth-layout, .content-grid { grid-template-columns: 1fr; }
  .auth-layout { padding-top: 25px; }
  .auth-story { max-width: none; }
  .promise-list { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .page-heading { align-items: start; flex-direction: column; gap: 16px; }
  .admin-metrics { grid-template-columns: repeat(3, 1fr); }
  .custom-link-form { grid-template-columns: 1fr; align-items: stretch; }
  .custom-link-form .small-primary { width: 100%; }
  .admin-table-wrap { overflow: visible; }
  .admin-table-wrap table, .admin-table-wrap tbody, .admin-table-wrap tr, .admin-table-wrap td { display: block; width: 100%; min-width: 0; }
  .admin-table-wrap thead { display: none; }
  .admin-table-wrap tbody { display: grid; gap: 12px; }
  .admin-table-wrap tr { padding: 8px 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.35); }
  .admin-table-wrap td { display: grid; grid-template-columns: minmax(92px, .4fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
  .admin-table-wrap td:first-child { border-top: 0; }
  .admin-table-wrap td::before { content: attr(data-label); color: var(--ink-soft); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
}
@media (max-width: 620px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .site-footer { width: min(100% - 24px, 1160px); align-items: flex-start; flex-direction: column; }
  .mobile-tab-bar { position: fixed; left: 12px; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 20; min-height: 58px; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; border: 1px solid rgba(23,63,53,.12); border-radius: 19px; color: rgba(23,63,53,.58); background: rgba(251,248,241,.9); box-shadow: 0 8px 28px rgba(13,47,40,.14); backdrop-filter: blur(18px); }
  .mobile-tab-bar a { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; color: inherit; text-decoration: none; font-size: 8.5px; font-weight: 700; letter-spacing: .02em; }
  .mobile-tab-bar svg { width: 18px; height: 18px; }
  .mobile-tab-bar [aria-current="page"] { color: var(--ink-deep); }
  .mobile-tab-bar [aria-current="page"]::after { content: ""; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--brass); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .shell { width: min(100% - 24px, 1160px); }
  .topbar { min-height: 72px; }
  .top-actions .quiet-link:not(.mobile-priority) { display: none; }
  .auth-layout { min-height: calc(100vh - 72px); gap: 32px; }
  .auth-story h1 { font-size: 48px; }
  .auth-card { border-radius: 23px; }
  .auth-tabs { grid-template-columns: 1fr; }
  .auth-tab { min-height: 36px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 105px; padding: 17px; }
  .activity-card { grid-template-columns: 1fr; gap: 9px; }
  .activity-count { text-align: left; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .custom-link-card { align-items: flex-start; flex-direction: column; }
}
