/* akhileshdixit.com shared look. Calm, crisp, fast: system fonts (no web-font download), small corners.
   Link it first:  <link rel="stylesheet" href="/shared/theme.css">
   Then use the classes below, or the --tokens in your own CSS.
   Owned by the dashboard thread; tools add their own CSS on top, never edit this file. */

/* Themes: set <html data-theme="light|dark|amoled|claude|github">; no attribute (or "auto") follows the system.
   /shared/theme.js applies the saved choice and adds the picker. */
:root {
  /* light: clean editorial, airy, calm blue */
  --bg: #fafaf8;          /* page */
  --surface: #ffffff;     /* cards, inputs */
  --surface-2: #f1f1ee;   /* subtle fills: hover, stripes, chips */
  --text: #16181d;
  --muted: #646872;
  --line: #e6e6e1;
  --accent: #2459d6;      /* links, primary buttons, focus */
  --accent-soft: #e6edfc;
  --on-accent: #ffffff;
  --good: #1f7a4d;  --good-soft: #e2f3ea;
  --warn: #9a5b06;  --warn-soft: #fbf0dc;
  --bad:  #b4382a;  --bad-soft:  #fbe5e1;
  --shadow: 0 1px 2px rgba(16, 20, 30, .04), 0 8px 24px rgba(16, 20, 30, .05);
  color-scheme: light;

  /* type */
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12.5px; --fs-sm: 14px; --fs: 15.5px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 32px; --fs-3xl: 48px;

  /* shape and space */
  --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-pill: 6px;   /* small, crisp corners */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --page: 1180px;        /* tuned for a 14" laptop: 1280-1536 CSS px wide */
  --sidebar: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
/* soft dark (Auto at night, or picked as "Dark") */
:root[data-theme="dark"] {
  --bg: #121417; --surface: #1a1d21; --surface-2: #23272c; --text: #eceef1; --muted: #9ba1ab; --line: #2c3036;
  --accent: #7aa2ff; --accent-soft: #1d2a45; --on-accent: #0b1220;
  --good: #6fd09b; --good-soft: #17301f; --warn: #e8b35e; --warn-soft: #33281a; --bad: #f29a8c; --bad-soft: #3a211d;
  --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --bg: #121417; --surface: #1a1d21; --surface-2: #23272c; --text: #eceef1; --muted: #9ba1ab; --line: #2c3036;
    --accent: #7aa2ff; --accent-soft: #1d2a45; --on-accent: #0b1220;
    --good: #6fd09b; --good-soft: #17301f; --warn: #e8b35e; --warn-soft: #33281a; --bad: #f29a8c; --bad-soft: #3a211d;
    --shadow: none; color-scheme: dark;
  }
}
/* AMOLED: pure black, saves battery on OLED phones */
:root[data-theme="amoled"] {
  --bg: #000000; --surface: #0b0b0c; --surface-2: #161618; --text: #f4f4f5; --muted: #a1a1aa; --line: #232326;
  --accent: #6c9bff; --accent-soft: #111a2e; --on-accent: #000000;
  --good: #5fd38d; --good-soft: #0c2015; --warn: #f0b45a; --warn-soft: #251a0b; --bad: #ff8a7a; --bad-soft: #2a110d;
  --shadow: none; color-scheme: dark;
}
/* Claude: matches the Claude app's dark look: warm charcoal, darker sidebar, clay-orange accent, warm off-white text */
:root[data-theme="claude"] {
  --bg: #262624; --surface: #30302e; --surface-2: #3a3936; --text: #f5f4ef; --muted: #a8a59c; --line: #3f3e3a;
  --accent: #d97757; --accent-soft: #41291f; --on-accent: #1f1e1d;
  --good: #8cc59a; --good-soft: #233026; --warn: #e3b067; --warn-soft: #3a2f1e; --bad: #ec8f7c; --bad-soft: #452822;
  --shadow: none; color-scheme: dark;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="claude"] .shell-nav { background: #1f1e1d; }
:root[data-theme="claude"] body { letter-spacing: 0.005em; }
/* GitHub dark */
:root[data-theme="github"] {
  --bg: #0d1117; --surface: #161b22; --surface-2: #21262d; --text: #e6edf3; --muted: #8b949e; --line: #30363d;
  --accent: #4493f8; --accent-soft: #12233b; --on-accent: #ffffff;
  --good: #3fb950; --good-soft: #12261a; --warn: #d29922; --warn-soft: #2b2111; --bad: #f85149; --bad-soft: #2d1416;
  --shadow: none; color-scheme: dark;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 var(--s2); letter-spacing: -0.01em; }
.display { font-family: var(--display); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: var(--fs-xl); font-weight: 650; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0 0 var(--s3); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* layout */
.page { max-width: var(--page); margin: 0 auto; padding: var(--s7) var(--s4) 72px; }
.page.narrow { max-width: 460px; }
.page.medium { max-width: 720px; }
.stack > * + * { margin-top: var(--s3); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.spacer { flex: 1; }

/* page header: back link, title, one line of help */
.back { display: inline-flex; gap: 6px; align-items: center; margin-bottom: var(--s5); color: var(--muted); text-decoration: none; font-size: var(--fs-sm); }
.back:hover { color: var(--text); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: var(--s7) 0 var(--s3); }
.index { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .04em; }
.lead { font-size: var(--fs-lg); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
a.card, .card.link, .card.hover { display: block; color: inherit; text-decoration: none;
  transition: border-color .2s var(--ease), transform .25s var(--spring), box-shadow .25s var(--ease); }
a.card:hover, .card.link:hover, .card.hover:hover { border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 16px 32px -12px color-mix(in srgb, var(--accent) 35%, transparent); }
a.card:active, .card.link:active { transform: translateY(-1px) scale(.99); }
.card .icon { font-size: 28px; line-height: 1; margin-bottom: var(--s3); color: var(--accent); }
.ico-svg { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.15em; flex: none; }

/* big number tiles */
.stat .value { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: var(--fs-sm); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); cursor: pointer; text-decoration: none; user-select: none;
  transition: border-color .15s, background .15s, transform .18s var(--spring), box-shadow .2s var(--ease); }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.96); transition-duration: .06s; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* forms */
label { display: block; font-weight: 600; font-size: var(--fs-sm); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { display: inline; width: auto; margin: 0 8px 0 0; accent-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }

/* chips, badges and messages */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); background: var(--surface-2); color: var(--text); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad  { background: var(--bad-soft);  color: var(--bad); }
.note { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2); }
.note.good { background: var(--good-soft); color: var(--good); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad, .error { background: var(--bad-soft); color: var(--bad); padding: var(--s3) var(--s4); border-radius: var(--r); }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }

/* tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
tr:hover td { background: var(--surface-2); }
.num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* simple top tabs for a tool */
.tabs { display: flex; gap: var(--s1); overflow-x: auto; padding: var(--s1); background: var(--surface-2); border-radius: var(--r); margin-bottom: var(--s5); }
.tabs a, .tabs button { flex: none; padding: 8px 14px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.tabs a[aria-current="page"], .tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* theme picker (added by /shared/theme.js) */
.theme-picker { position: fixed; right: 16px; bottom: 16px; z-index: 50; }
.theme-picker > button { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.theme-picker > button:hover { border-color: var(--accent); }
.theme-menu { position: absolute; right: 0; bottom: 54px; min-width: 200px; padding: 6px; margin: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.theme-menu[hidden] { display: none; }
.theme-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button[aria-checked="true"] { font-weight: 650; }
.theme-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.theme-menu .sw { width: 16px; height: 16px; border-radius: 3px; border: 1px solid rgba(128,128,128,.4); flex: none; }

/* ============ App shell: sidebar on the left, content on the right (added by /shared/shell.js) ============ */
body.has-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
body.has-shell > * { grid-column: 2; }
body.has-shell > .shell-nav { grid-column: 1; grid-row: 1 / span 99; }
body.has-shell .page { padding-top: var(--s6); width: 100%; }
.shell-nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: var(--s5) var(--s3);
  background: var(--surface); border-right: 1px solid var(--line); view-transition-name: shell-nav; overflow-y: auto; }
.shell-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px var(--s5); color: var(--text); text-decoration: none; font-weight: 700; }
.shell-brand .mark { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 14px; }
.shell-label { margin: var(--s4) 10px var(--s1); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.shell-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--muted);
  text-decoration: none; font-weight: 550; transition: background .15s, color .15s, transform .2s var(--spring); }
.shell-link .ico { width: 26px; text-align: center; font-size: 18px; transition: transform .3s var(--spring); }
.shell-link:hover { background: var(--surface-2); color: var(--text); }
.shell-link:hover .ico { transform: scale(1.18) rotate(-6deg); }
.shell-link[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.shell-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.shell-link kbd { margin-left: auto; }
.shell-foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--line); display: grid; gap: 2px; }
.shell-foot .theme-picker { position: static; }
.shell-foot .theme-picker > button { width: 100%; height: auto; border-radius: var(--r-sm); border: 0; box-shadow: none; background: transparent;
  display: flex; gap: 12px; padding: 9px 10px; color: var(--muted); font: inherit; font-weight: 550; justify-content: flex-start; }
.shell-foot .theme-picker > button:hover { background: var(--surface-2); color: var(--text); }
.shell-foot .theme-picker > button .tp-label { display: inline; }
.shell-foot .theme-menu { left: 0; right: auto; bottom: 46px; }
.theme-picker > button .tp-label { display: none; }
@media (max-width: 1000px) {
  :root { --sidebar: 76px; }
  .shell-nav .txt, .shell-label, .shell-link kbd, .shell-foot .tp-label { display: none !important; }
  .shell-link, .shell-brand, .shell-foot .theme-picker > button { justify-content: center; }
}

/* ============ Desktop helpers ============ */
.cols { display: grid; gap: var(--s5); }
.cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.split > .side { position: sticky; top: var(--s5); }
@media (max-width: 1100px) { .cols.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } .split > .side { position: static; } }
@media (max-width: 760px) { .cols.c2, .cols.c3, .cols.c4 { grid-template-columns: 1fr; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.page-head h1 { margin: 0; }
kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); border-bottom-width: 2px; color: var(--muted); background: var(--surface); }
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; min-height: 1em; }
.stat .value { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.progress { height: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }

/* ============ Motion: small rewards for doing things ============ */
@view-transition { navigation: auto; }                   /* smooth page-to-page fades (Chrome/Edge) */
::view-transition-old(root) { animation: vt-out .1s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .16s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { opacity: .001; transform: translateY(6px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
.rise { animation: rise .2s var(--ease) both; }
.stagger > * { animation: rise .2s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .02s; } .stagger > *:nth-child(3) { animation-delay: .04s; }
.stagger > *:nth-child(4) { animation-delay: .06s; } .stagger > *:nth-child(n+5) { animation-delay: .08s; }
.pop { animation: pop .45s var(--spring); }
.wiggle { animation: wiggle .4s ease-in-out; }
.ring { animation: ring .7s ease-out; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); font-weight: 600; border: 1px solid transparent;
  background: var(--text); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s var(--ease) both; }
.toast.good { background: var(--good-soft); color: var(--good); border-color: var(--good); } .toast.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); } .toast.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.toast.out { animation: vt-out .25s var(--ease) forwards; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

@media (max-width: 560px) {
  :root { --fs-3xl: 40px; --fs-2xl: 30px; --fs-xl: 22px; }
  .page { padding-top: var(--s6); }
  .card { padding: var(--s4); }
}
/* Dock on separate-app pages: Home, theme, sign out */
.app-dock { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; align-items: center; gap: 4px; padding: 4px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line);
  border-radius: var(--r-pill); box-shadow: var(--shadow); animation: rise .4s var(--spring) both; }
.app-dock.inline { position: static; box-shadow: none; animation: none; background: transparent; border: 0; padding: 0; flex-wrap: wrap; }
.dock-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sm, 14px); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .2s var(--spring); }
.dock-btn:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.dock-btn:active { transform: scale(.95); }
.app-dock .theme-picker { position: static; }
.app-dock .theme-picker > button { width: 36px; height: 36px; border: 0; box-shadow: none; background: transparent; }
.app-dock .theme-picker > button:hover { background: var(--surface-2); }
.app-dock .theme-picker .tp-label { display: none; }
.app-dock .theme-menu { right: 0; left: auto; bottom: 46px; top: auto; }
@media (max-width: 1100px) { .app-dock:not(.inline) .dock-btn .txt { display: none; } }
@media print { .app-dock { display: none; } }
@media print { .theme-picker, .shell-nav { display: none; } body.has-shell { display: block; } body { background: #fff; color: #000; } .noprint { display: none !important; } .card { box-shadow: none; } }
