/* Ought Tools. Palette: ink #14213D, saffron #F2A114, paper #F6F7F9, teal #0F8F83, line #E2E6EE */
:root, [data-bs-theme="light"] {
  --ink: #14213d; --saffron: #f2a114; --saffron-dark: #d98a00; --paper: #f6f7f9; --teal: #0f8f83; --line: #e2e6ee;
  --surface: #ffffff; --muted: #5b6577;
  --bs-primary: #14213d; --bs-primary-rgb: 20, 33, 61;
  --bs-link-color: #1d4fb8; --bs-link-hover-color: #14213d;
  --bs-body-bg: var(--paper); --bs-body-color: #1b2333;
  --bs-body-font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-border-color: var(--line);
  --radius: 14px;
}
[data-bs-theme="dark"] {
  --surface: #172036; --paper: #0e1626; --line: #28334d; --muted: #9aa6bd; --ink: #e8edf7;
  --bs-body-bg: #0e1626; --bs-body-color: #e4e9f3; --bs-link-color: #8fb4ff; --bs-link-hover-color: #fff;
  --bs-primary: #8fb4ff; --bs-primary-rgb: 143, 180, 255; --bs-border-color: var(--line);
}
body { font-family: var(--bs-body-font-family); line-height: 1.6; }
h1, h2, h3, h4, h5, .brand-word, .navbar-brand, .hero-title, .stat-val, .error-code { font-family: 'Bricolage Grotesque', 'Figtree', sans-serif; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

/* buttons */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { --bs-btn-bg: #14213d; --bs-btn-border-color: #14213d; --bs-btn-hover-bg: #223461; --bs-btn-hover-border-color: #223461; --bs-btn-active-bg: #0e1830; --bs-btn-color: #fff; }
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #8fb4ff; --bs-btn-border-color: #8fb4ff; --bs-btn-color: #0e1626; --bs-btn-hover-bg: #b3cbff; --bs-btn-hover-border-color: #b3cbff; --bs-btn-hover-color: #0e1626; }
.btn-outline-primary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-color: var(--surface); --bs-btn-hover-border-color: var(--ink); --bs-btn-active-bg: var(--ink); --bs-btn-active-color: var(--surface); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #cfdcff; }
.btn-accent { --bs-btn-bg: var(--saffron); --bs-btn-border-color: var(--saffron); --bs-btn-color: #1a1300; --bs-btn-hover-bg: var(--saffron-dark); --bs-btn-hover-border-color: var(--saffron-dark); --bs-btn-hover-color: #1a1300; --bs-btn-active-bg: var(--saffron-dark); }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--bs-body-color); }
.form-control, .form-select { border-radius: 10px; background-color: var(--surface); border-color: var(--line); min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--saffron); box-shadow: 0 0 0 .2rem rgba(242, 161, 20, .25); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .75rem 1rem; }
.table thead th { font-size: .8rem; color: var(--muted); font-weight: 600; border-bottom-color: var(--line); white-space: nowrap; }
.row-deleted { opacity: .65; background: rgba(120, 120, 120, .06); }

/* public nav + footer */
.site-nav { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.navbar-brand { font-weight: 800; font-size: 1.25rem; color: var(--bs-body-color); }
.navbar .nav-link { font-weight: 500; }
.navbar .nav-link.active { color: var(--bs-body-color); box-shadow: inset 0 -2px 0 var(--saffron); }
.clock-pill { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.site-footer a { color: inherit; }

/* hero */
.hero { padding: 3.5rem 0 2.5rem; background: var(--surface) url('../img/grid.svg') center top / 520px repeat; border-bottom: 1px solid var(--line); }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.05; margin-bottom: 1rem; max-width: 14em; }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 34rem; }
.hero-search { position: relative; display: flex; gap: .5rem; margin-top: 1.5rem; max-width: 36rem; }
.hero-search .bi-search { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 2; }
.hero-search .form-control { padding-left: 2.6rem; min-height: 52px; }
.hero-search .btn { padding-inline: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: .88rem; color: var(--bs-body-color); text-decoration: none; }
.chip:hover, .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.demo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; box-shadow: 0 18px 40px -24px rgba(20, 33, 61, .45); }
.demo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; gap: .5rem; flex-wrap: wrap; }
.demo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .9rem; }
.demo-stats div { background: var(--paper); border-radius: 10px; padding: .5rem; text-align: center; }
.demo-stats b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.demo-stats span { font-size: .75rem; color: var(--muted); }

/* sections, tiles, cards */
.section { padding-top: 2.2rem; }
.cat-tile { display: flex; flex-direction: column; gap: .15rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; height: 100%; }
.cat-tile:hover { border-color: var(--tint, var(--ink)); }
.cat-icon, .tool-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, var(--tint, #14213d) 14%, transparent); color: var(--tint, #14213d); flex: none; }
.cat-icon { margin-bottom: .6rem; }
.cat-name { font-weight: 700; } .cat-count { font-size: .85rem; color: var(--muted); }
.t1 { --tint: #1d4fb8; } .t2 { --tint: #0f8f83; } .t3 { --tint: #c2410c; } .t4 { --tint: #7c3aed; } .t5 { --tint: #b45309; } .t6 { --tint: #be185d; } .t7 { --tint: #0369a1; }
[data-bs-theme="dark"] .cat-icon, [data-bs-theme="dark"] .tool-icon { --tint: #8fb4ff; }
.tool-icon { --tint: #1d4fb8; }
.tool-icon.lg { width: 60px; height: 60px; font-size: 1.8rem; border-radius: 16px; }
.tool-icon.sm { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }
.tool-card { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; height: 100%; position: relative; }
.tool-card:hover { border-color: var(--saffron); box-shadow: 0 8px 24px -16px rgba(20, 33, 61, .5); }
.tool-card.tall { flex-direction: column; min-height: 150px; }
.tool-body { display: flex; flex-direction: column; min-width: 0; }
.tool-name { font-weight: 700; } .tool-desc { font-size: .88rem; color: var(--muted); }
.tool-card.is-soon .tool-icon { filter: grayscale(1); opacity: .7; }
.soon-badge { position: absolute; top: .7rem; right: .7rem; font-weight: 500; }
.privacy-band { display: flex; gap: 1.5rem; align-items: center; padding: 1.5rem; border-radius: 18px; background: var(--ink); color: #eaf0ff; }
[data-bs-theme="dark"] .privacy-band { background: #1b2a49; }
.privacy-band img { flex: none; }
@media (max-width: 575px) { .privacy-band { flex-direction: column; text-align: center; } .demo-stats { grid-template-columns: repeat(2, 1fr); } .hero-search { flex-direction: column; } }

/* tool workbench */
.workbench { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem; }
.workbench textarea { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92rem; }
.tool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-top: 1rem; }
.tool-stats div { background: var(--paper); border-radius: 12px; padding: .7rem; text-align: center; }
.tool-stats b { display: block; font-size: 1.6rem; font-family: 'Bricolage Grotesque', sans-serif; font-variant-numeric: tabular-nums; }
.tool-stats span { font-size: .8rem; color: var(--muted); }
.soon-panel { display: flex; gap: 1.5rem; align-items: center; padding: 1.5rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; }
@media (max-width: 575px) { .soon-panel { flex-direction: column; text-align: center; } }

/* auth + install */
.auth-wrap { display: grid; place-items: center; padding: 3rem 0; }
.auth-card { width: 100%; max-width: 26rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem; box-shadow: 0 18px 40px -28px rgba(20, 33, 61, .5); }
body.bare { background: var(--paper) url('../img/grid.svg') center / 520px; }
.bare-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.bare-card { width: 100%; max-width: 34rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem; }
.check-list li { display: flex; gap: .6rem; padding: .3rem 0; align-items: flex-start; }
.check-list .ok i { color: var(--teal); } .check-list .bad i { color: #c62828; }
.danger-zone { border-color: rgba(198, 40, 40, .4); }
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--saffron); line-height: 1; margin-bottom: .25rem; }

/* admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 250px; flex: none; background: #101a31; color: #cdd7ee; padding: 1.25rem 1rem; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-side-off { background: #101a31; color: #cdd7ee; width: 270px; }
.brand-side { color: #fff; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 10px; color: #cdd7ee; text-decoration: none; font-weight: 500; }
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-link.active { background: var(--saffron); color: #1a1300; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { display: flex; align-items: center; gap: .6rem; padding: .75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.admin-body { padding: 1.25rem; max-width: 1280px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; height: 100%; position: relative; }
.stat-card > .bi { position: absolute; right: 1rem; top: 1rem; font-size: 1.3rem; color: var(--muted); }
.stat-val { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 600; font-size: .9rem; }
.health-dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; }
.health-item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; background: var(--paper); border-radius: 10px; height: 100%; }
.detail-list { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; margin: 0; }
.detail-list dt { color: var(--muted); font-weight: 500; } .detail-list dd { margin: 0; }
@media (max-width: 575px) { .detail-list { grid-template-columns: 1fr; gap: 0; } .detail-list dd { margin-bottom: .6rem; } }
.badge-lv-info { background: #e0ecff; color: #1d4fb8; } .badge-lv-warning { background: #fff1d6; color: #8a5a00; }
.badge-lv-error { background: #ffe0e0; color: #a31515; } .badge-lv-critical { background: #a31515; color: #fff; }
.log-table summary { cursor: pointer; }
.trace { max-height: 240px; overflow: auto; background: var(--paper); padding: .75rem; border-radius: 8px; font-size: .78rem; white-space: pre-wrap; word-break: break-all; margin: 0; }
@media print { .site-nav, .site-footer, .admin-side, .admin-top { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* file tool result */
.result-preview { background: repeating-conic-gradient(#e9ecf2 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: 12px; padding: 1rem; text-align: center; overflow: auto; }
.result-preview img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .5); }

/* reports chart */
.report-chart { width: 100%; height: auto; display: block; }
.report-chart .bar-u { fill: var(--ink); } .report-chart .bar-g { fill: var(--saffron); }
[data-bs-theme="dark"] .report-chart .bar-u { fill: #8fb4ff; }
.report-chart .cl { stroke: var(--line); } .report-chart .ct { font-size: 10px; fill: var(--muted); }
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; vertical-align: middle; }
.lg-u { background: var(--ink); } .lg-g { background: var(--saffron); }
[data-bs-theme="dark"] .lg-u { background: #8fb4ff; }

/* two-factor */
.code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.code-grid code, .secret-box { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; font-size: 1rem; text-align: center; letter-spacing: .08em; color: var(--bs-body-color); }
.secret-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; word-break: break-all; }

/* emailed code input */
.otp-input { letter-spacing: .35em; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
/* admin email page */
.acct-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--surface); }
.meter { height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--teal); }
.meter.warn > span { background: var(--saffron); } .meter.full > span { background: #c62828; }
.chip-sm { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; background: var(--paper); border: 1px solid var(--line); margin: 0 .25rem .25rem 0; }

/* meta tag and social previews */
.preview-pane { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; }
.serp { font-family: Arial, Helvetica, sans-serif; max-width: 600px; }
.serp.mobile { max-width: 380px; }
.serp-url { font-size: 12px; color: #4d5156; margin-bottom: 2px; } .serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin-bottom: 3px; white-space: nowrap; overflow: hidden; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; } .serp.mobile .serp-title { white-space: normal; }
[data-bs-theme="dark"] .serp-url, [data-bs-theme="dark"] .serp-desc { color: #bdc1c6; } [data-bs-theme="dark"] .serp-title { color: #8ab4f8; }
.sp-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 520px; background: var(--paper); }
.sp-img { aspect-ratio: 1.91 / 1; background: var(--line); display: grid; place-items: center; color: var(--muted); overflow: hidden; } .sp-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-body { padding: .7rem .9rem; } .sp-host { font-size: .72rem; color: var(--muted); letter-spacing: .02em; } .sp-title { font-weight: 700; line-height: 1.3; margin: .1rem 0; }
.sp-desc { font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-card.x { border-radius: 16px; } .sp-card.wa { display: flex; max-width: 420px; border-radius: 10px; } .sp-thumb { width: 96px; flex: none; background: var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); } .sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.check-list .warn i { color: #b45309; }

/* email builder */
.blk { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .6rem; background: var(--paper); }
.email-frame-wrap { background: repeating-conic-gradient(#e9ecf2 0% 25%, #f7f8fb 0% 50%) 50% / 18px 18px; border: 1px solid var(--line); border-radius: 12px; padding: .6rem; display: flex; justify-content: center; overflow: auto; }
.email-frame { border: 0; background: #fff; border-radius: 8px; height: 560px; max-width: 100%; width: 100%; }

.tw-out { background: var(--paper); border: 1px solid var(--line); color: var(--bs-body-color); font-size: .85rem; white-space: normal; word-break: break-word; line-height: 1.7; }

.it-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); vertical-align: middle; background: repeating-conic-gradient(#e9ecf2 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
