:root {
  --bg: #fcfcfb; --ink: #17170f; --muted: #9b9b91;
  --hair: rgba(0,0,0,0.12); --box: #f6f6f3; --err: #b4341f; --ok: #2f7d4f;
  --sans: "Geist", -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}

/* Header */
header { display: flex; align-items: center; justify-content: space-between; padding: 30px 40px; border-bottom: 1px solid var(--hair); animation: fade .9s ease both; }
.page-index header { border-bottom: none; }
.mark { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.mark .d { color: var(--muted); }
header .right { display: flex; align-items: center; gap: 20px; }
header .who { font-family: var(--mono); font-size: 13px; color: var(--muted); }
header a, header button, header a.alt { font-family: var(--sans); font-size: 14px; color: var(--muted); background: none;
  border: none; cursor: pointer; transition: color .2s; text-decoration: none; }
header a:hover, header button:hover, header a.alt:hover { color: var(--ink); }

/* Common UI */
.collapsible { display: flex; gap: 22px; align-items: center; }
.ham-btn { display: none; background: none; border: none; cursor: pointer; color: var(--muted); padding: 0 4px; transition: color .2s; }
.ham-btn:hover { color: var(--ink); }

/* Main Elements */
.page-index main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px 80px; }
.page-dashboard main { flex: 1; width: min(720px, 100%); margin: 0 auto; padding: 56px 24px 80px; }
.page-form main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px 24px 70px; }
.page-content main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 24px 80px; }

/* Dashboard Specific */
.page-dashboard h1 { font-size: 38px; font-weight: 300; letter-spacing: -0.03em; margin-bottom: 6px; }
.sub { font-size: 15px; color: var(--muted); margin-bottom: 44px; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; background: #fff; border: 1px solid var(--hair); border-radius: 8px; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); transition: transform .2s, box-shadow .2s; }
.row:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.row .name { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.row .status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ok); background: rgba(47, 125, 79, 0.1); padding: 4px 8px; border-radius: 4px; }
.empty { font-size: 15px; color: var(--muted); padding: 22px 0; }
.add { display: flex; gap: 10px; margin-top: 28px; max-width: 460px; }
.add .ipt { flex: 1; display: flex; align-items: center; border: 1px solid var(--hair); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); transition: border-color .2s; }
.add .ipt:focus-within { border-color: var(--ink); }
.add input { flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-family: var(--mono); font-size: 15px; padding: 11px 12px; color: var(--ink); }
.add .sfx { font-family: var(--mono); font-size: 15px; color: var(--muted); padding-right: 12px; }
.add button { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--bg);
  background: var(--ink); border: none; border-radius: 4px; padding: 0 22px; cursor: pointer; }
.del-btn { font-family: var(--sans); font-size: 13px; color: var(--err); background: none; border: 1px solid var(--err); border-radius: 4px; padding: 4px 8px; cursor: pointer; transition: all .2s; }
.del-btn:hover { background: var(--err); color: var(--bg); }
.danger-zone { margin-top: 60px; padding: 24px; border: 1px solid rgba(180, 52, 31, 0.2); border-radius: 8px; background: rgba(180, 52, 31, 0.03); }
.danger-zone .label { border: none; padding: 0; margin-bottom: 8px; color: var(--err); }
.danger-zone p { font-size: 14px; color: var(--ink); opacity: 0.8; margin-bottom: 20px; }

.dns-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink); background: var(--box); border: 1px solid var(--hair); padding: 6px 12px; border-radius: 100px; text-decoration: none; transition: all .2s; }
.dns-pill:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Index Specific */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 34px; animation: rise 1s cubic-bezier(.2, .7, .2, 1) .1s both; }
.page-index h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 300; letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 52px; animation: rise 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
.page-index h1 .em { font-weight: 500; }
.field { width: min(460px, 100%); animation: rise 1s cubic-bezier(.2, .7, .2, 1) .32s both; }
.input { display: flex; align-items: center; border-bottom: 1.5px solid var(--ink); padding: 12px 4px; }
.input input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: var(--mono); font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.input input::placeholder { color: #c9c9c1; }
.input .sfx { font-family: var(--mono); font-size: 22px; color: var(--muted); letter-spacing: -0.01em; }
.msg { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 16px; min-height: 18px; text-align: left; padding-left: 4px; transition: color .25s; }
.msg.ok { color: var(--ok); cursor: pointer; }
.msg.no { color: #b4341f; }
.meta { display: flex; gap: 26px; margin-top: 64px; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; animation: rise 1s cubic-bezier(.2, .7, .2, 1) .44s both; }
.meta span { display: flex; align-items: center; gap: 8px; }
.meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); opacity: .55; }

/* Form Cards (Login, Register, Abuse) */
.card { width: min(400px, 100%); animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.card h1 { font-size: 34px; font-weight: 300; letter-spacing: -0.03em; margin-bottom: 8px; }
.lede { font-size: 15px; color: var(--muted); margin-bottom: 38px; }
.group { margin-bottom: 24px; }
.card label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.card .ipt { display: flex; align-items: center; border-bottom: 1.5px solid var(--ink); transition: border-color .25s; }
.card .ipt input, .card .ipt select, .card .ipt textarea { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: var(--mono); font-size: 17px; color: var(--ink); padding: 8px 2px; }
.card .ipt input::placeholder, .card .ipt textarea::placeholder { color: #c9c9c1; }
.card .ipt textarea { resize: vertical; min-height: 80px; }
.card .btn { width: 100%; margin-top: 12px; font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--bg); background: var(--ink); border: 1.5px solid var(--ink); padding: 15px; border-radius: 4px; cursor: pointer; transition: opacity .2s, transform .1s; }
.card .btn:hover { opacity: .88; }
.card .btn:active { transform: scale(.99); }
.card .btn:disabled { opacity: .45; cursor: default; }
.note { font-family: var(--mono); font-size: 13px; margin-top: 18px; min-height: 18px; color: var(--muted); }
.note.ok { color: var(--ok); }
.note.no { color: var(--err); }
.switch { font-size: 14px; color: var(--muted); margin-top: 26px; }
.switch a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); }
.switch a:hover { border-color: var(--ink); }

/* Content Pages (Terms, Privacy) */
.content { width: min(600px, 100%); animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.page-content h1 { font-size: 34px; font-weight: 300; letter-spacing: -0.03em; margin-bottom: 24px; }
.page-content h2 { font-size: 18px; font-weight: 500; margin-top: 32px; margin-bottom: 12px; }
.page-content p, .page-content ul { font-size: 15px; color: var(--ink); line-height: 1.6; margin-bottom: 16px; }
.page-content ul { padding-left: 20px; }
.page-content li { margin-bottom: 8px; }

/* Footer */
footer { padding: 26px 40px; display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); border-top: 1px solid var(--hair); animation: fade 1s ease .6s both; }
footer .links { display: flex; gap: 22px; flex-wrap: wrap; }
footer .links a { color: var(--muted); text-decoration: none; transition: color .2s; }
footer .links a:hover { color: var(--ink); }

/* Animations */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 700px) {
  header, footer, .page-dashboard main, .page-index main, .page-form main, .page-content main { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 480px) {
  .page-index main { justify-content: flex-start; padding-top: 8vh; }
  .page-form main { padding-top: 36px; }
  .page-dashboard main { padding-top: 36px; }
  .page-index h1 { font-size: clamp(34px, 11vw, 48px); margin-bottom: 38px; }
  .page-dashboard h1, .card h1, .page-content h1 { font-size: 30px; }
  .input input, .input .sfx { font-size: 20px; }
  .meta { gap: 10px 20px; margin-top: 44px; flex-wrap: wrap; justify-content: center; }
  .box { max-width: 100%; border-radius: 0; border: none; border-bottom: 1px solid var(--hair); border-top: 1px solid var(--hair); box-shadow: none; padding: 32px 20px; margin-top: 20px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  header, footer { padding-left: 20px; padding-right: 20px; }
  footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(252, 252, 251, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    flex-direction: row; gap: 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); justify-content: space-between; align-items: center; }
  footer .links { gap: 16px; }
  .t-txt { display: none; }
  .collapsible { display: none; position: absolute; bottom: calc(100% + 10px); right: 20px;
    background: var(--bg); border: 1px solid var(--hair); border-radius: 6px;
    padding: 14px 18px; flex-direction: column; gap: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); text-align: right; }
  .collapsible.open { display: flex; }
  .ham-btn { display: flex; align-items: center; }

  /* Dashboard Mobile */
  .page-dashboard main { padding: 32px 20px 100px; }
  .page-dashboard h1 { font-size: 30px; }
  .row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .row > div { width: 100%; justify-content: space-between; margin-top: 4px; }
  .add { flex-direction: column; max-width: 100%; gap: 12px; }
  .add button { width: 100%; padding: 12px 0; }
  
  /* Records Modal Mobile */
  .modal-header h2 { font-size: 18px; }
  .record-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Cookie Banner */
.cookie-banner { position: fixed; bottom: 20px; left: 20px; right: 20px; margin: 0 auto; max-width: 460px; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 16px 20px; display: none; flex-direction: column; gap: 14px; z-index: 1000; box-shadow: 0 8px 24px rgba(0,0,0,0.15); animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
.cookie-banner.show { display: flex; }
.cb-content { font-size: 14px; line-height: 1.5; color: rgba(252, 252, 251, 0.85); }
.cb-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.cb-link { color: var(--bg); text-decoration: none; font-size: 13px; font-family: var(--mono); border-bottom: 1px solid rgba(252, 252, 251, 0.3); transition: border-color .2s; }
.cb-link:hover { border-color: var(--bg); }
.cb-btn { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; font-weight: 500; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; transition: opacity .2s; }
.cb-btn:hover { opacity: .9; }

@media (max-width: 480px) {
  .cookie-banner { top: 10px; bottom: auto; left: 10px; right: 10px; width: auto; animation: drop .4s cubic-bezier(.2,.7,.2,1) both; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Records Modal */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; animation: fade .2s ease both; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg); width: min(800px, 100%); max-height: 90vh; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; animation: rise .3s cubic-bezier(.2,.7,.2,1) both; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--hair); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 20px; font-weight: 500; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 4px; transition: all .2s; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.record-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-family: var(--mono); font-size: 13px; }
.record-table th { text-align: left; padding: 12px; border-bottom: 1px solid var(--hair); color: var(--muted); font-weight: normal; letter-spacing: 0.05em; text-transform: uppercase; font-size: 11px; }
.record-table td { padding: 12px; border-bottom: 1px solid var(--hair); }
.record-table input, .record-table select { width: 100%; border: 1px solid var(--hair); background: #fff; padding: 6px 8px; border-radius: 4px; font-family: var(--mono); font-size: 13px; outline: none; transition: border-color .2s; }
.record-table input:focus, .record-table select:focus { border-color: var(--ink); }
.btn-small { display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); padding: 6px 12px; border-radius: 6px; font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-small:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.btn-small:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.btn-small.outline { background: #fff; color: var(--ink); border: 1px solid var(--hair); box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.btn-small.outline:hover { border-color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.btn-small.danger { background: #fff5f3; color: var(--err); border: 1px solid rgba(180,52,31,0.2); }
.btn-small.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }

/* Table Action Buttons */
.btn-action { background: transparent; border: none; font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer; padding: 6px 10px; border-radius: 4px; transition: all .2s; }
.btn-action.save { color: var(--ok); }
.btn-action.save:hover { background: rgba(47, 125, 79, 0.1); }
.btn-action.del { color: var(--err); }
.btn-action.del:hover { background: rgba(180, 52, 31, 0.1); }
