@import "tailwindcss";

@theme {
  --color-paper: #ffffff;
  --color-surface: #ffffff;
  --color-sunken: #f6f8fa;
  --color-inset: #f6f8fa;
  --color-raised: #ffffff;
  --color-ink: #1f2328;
  --color-ink-2: #59636e;
  --color-ink-3: #6e7781;
  --color-ink-4: #6e7781;
  --color-line: #d0d7de;
  --color-line-strong: #d0d7de;
  --color-line-hair: #d8dee4;
  --color-accent: #0969da;
  --color-accent-ink: #0550ae;
  --color-accent-soft: #ddf4ff;
  --color-accent-line: #54aeff66;
  --color-on-accent: #ffffff;
  --color-primary: #1f883d;
  --color-primary-hover: #1a7f37;
  --color-on-primary: #ffffff;
  --color-error: #cf222e;
  --color-error-emphasis: #cf222e;
  --color-error-muted: #ffebe9;
  --color-warn: #9a6700;
  --color-warn-muted: #fff8c5;
  --color-ok: #1a7f37;
  --color-ok-emphasis: #1f883d;
  --color-ok-muted: #dafbe1;
  --color-idle: #6e7781;
  --color-done: #8250df;
  --color-neutral: #818b981f;
  --color-tab: #fd8c73;
  --color-sticky-1: #fff8c5;
  --color-sticky-2: #dafbe1;
  --color-sticky-3: #ddf4ff;
  --color-sticky-4: #ffebe9;
  --color-focus: #0969da4d;
  --color-btn: #f6f8fa;
  --color-btn-hover: #eff2f5;
  --color-btn-active: #e6e9ec;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-xs: 6px;
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-small: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-pop: 0 1px 3px rgba(31, 35, 40, 0.12);
}

/* Outside @theme on purpose: Tailwind drops @theme variables no utility class
   references, and these are only ever read through var() built at runtime in
   components/scratchpad.tsx — inside @theme, three of the four vanished. */
:root {
  /* A notch stronger than the canvas stickies, which are tuned for a gridded
     board and wash out to near-white in a narrow column. */
  --color-jot-1: #fff1a8;
  --color-jot-2: #c8f0d2;
  --color-jot-3: #cfe8fc;
  --color-jot-4: #fdd8d8;
}

:root[data-theme="dark"] {
  --color-paper: #0d1117;
  --color-surface: #0d1117;
  --color-sunken: #161b22;
  --color-inset: #010409;
  --color-raised: #161b22;
  --color-ink: #e6edf3;
  --color-ink-2: #7d8590;
  --color-ink-3: #6e7681;
  --color-ink-4: #6e7681;
  --color-line: #30363d;
  --color-line-strong: #30363d;
  --color-line-hair: #21262d;
  --color-accent: #4493f8;
  --color-accent-ink: #1f6feb;
  --color-accent-soft: #388bfd1a;
  --color-accent-line: #4184e44d;
  --color-on-accent: #ffffff;
  --color-primary: #238636;
  --color-primary-hover: #2ea043;
  --color-on-primary: #ffffff;
  --color-error: #f85149;
  --color-error-emphasis: #da3633;
  --color-error-muted: #f851491a;
  --color-warn: #d29922;
  --color-warn-muted: #bb800926;
  --color-ok: #3fb950;
  --color-ok-emphasis: #238636;
  --color-ok-muted: #2ea04326;
  --color-idle: #6e7681;
  --color-done: #a371f7;
  --color-neutral: #656c7633;
  --color-tab: #fd8c73;
  --color-sticky-1: #bb800926;
  --color-sticky-2: #2ea04326;
  --color-sticky-3: #388bfd1a;
  --color-sticky-4: #f851491a;
  --color-jot-1: var(--color-sticky-1);
  --color-jot-2: var(--color-sticky-2);
  --color-jot-3: var(--color-sticky-3);
  --color-jot-4: var(--color-sticky-4);
  --color-focus: #4493f866;
  --color-btn: #21262d;
  --color-btn-hover: #30363d;
  --color-btn-active: #282e33;
  --shadow-small: 0 0 transparent;
  --shadow-pop: 0 1px 3px rgba(1, 4, 9, 0.6);
}

@layer base {
  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  html,
  body,
  #app {
    min-height: 100%;
    background: var(--color-paper);
    color: var(--color-ink);
  }

  body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
  }

  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }

  ::selection {
    background: var(--color-accent-soft);
    color: var(--color-ink);
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
    letter-spacing: -0.01em;
    font-weight: 600;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--color-accent);
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }

  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
  }

  kbd {
    font-family: var(--font-mono);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.dot-grid {
  background-color: var(--color-sunken);
  background-image: radial-gradient(circle, var(--color-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

.ruled-page {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    var(--color-line-hair) 28px
  );
  background-attachment: local;
  line-height: 28px;
}

.node-shape {
  vector-effect: non-scaling-stroke;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ledger-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-2);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-sunken);
  white-space: nowrap;
}

.ledger-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-line-hair);
  vertical-align: middle;
}

.ledger-table tbody tr {
  cursor: pointer;
}

.ledger-table tbody tr:hover td {
  background: var(--color-sunken);
}

.ledger-table tbody tr[data-active="true"] td {
  background: var(--color-accent-soft);
}

.ledger-table .r {
  text-align: right;
}

.ledger-table .m {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-thumb {
  background: var(--color-line);
  border: 3px solid var(--color-paper);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-ink-3);
}
::-webkit-scrollbar-track {
  background: transparent;
}

[data-sonner-toaster] [data-sonner-toast] {
  font-family: var(--font-sans) !important;
  border: 1px solid var(--color-line) !important;
  background: var(--color-surface) !important;
  color: var(--color-ink) !important;
  border-radius: 6px !important;
  box-shadow: var(--shadow-pop) !important;
}
