/* Design tokens: every colour, size and radius the app uses.
   The iOS app mirrors these in ios/FlooringSoft/Sources/Design/Theme.swift.
   Light is the default; dark follows the device setting. */

:root {
  color-scheme: light dark;

  /* Surfaces */
  --bg: #faf9f6;
  --bg-sidebar: #f2f1ec;
  --bg-raised: #ffffff;
  --bg-hover: rgba(20, 20, 18, 0.05);
  --bg-selected: rgba(20, 20, 18, 0.08);
  --bg-field: #ffffff;
  --scrim: rgba(20, 20, 18, 0.32);

  /* Lines */
  --line: rgba(20, 20, 18, 0.1);
  --line-strong: rgba(20, 20, 18, 0.18);

  /* Text */
  --text: #1a1a18;
  --text-2: #55534d;
  --text-3: #85837b;

  /* The one strong button: near-black on light, near-white on dark */
  --primary-bg: #1a1a18;
  --primary-text: #faf9f6;
  --primary-bg-hover: #33322e;

  /* Meaning */
  --focus: #3b7ddd;
  --danger: #c0392b;
  --danger-bg: rgba(192, 57, 43, 0.09);
  --positive: #2f7d4f;
  --positive-bg: rgba(47, 125, 79, 0.11);
  --info: #3668b5;
  --info-bg: rgba(54, 104, 181, 0.1);

  /* Shape */
  --radius-s: 6px;
  --radius-m: 9px;
  --radius-l: 14px;
  --radius-pill: 999px;
  --shadow-pop: 0 6px 24px rgba(20, 20, 18, 0.14), 0 0 0 1px var(--line);

  /* Size */
  --sidebar-width: 272px;
  --header-height: 56px;
  --control-height: 36px;
  --gutter: 28px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-s: 13px;
  --text-m: 15px;
  --text-l: 17px;
  --text-xl: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1a;
    --bg-sidebar: #151514;
    --bg-raised: #262624;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-selected: rgba(255, 255, 255, 0.1);
    --bg-field: #222220;
    --scrim: rgba(0, 0, 0, 0.55);

    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.17);

    --text: #f1f0ec;
    --text-2: #b8b6ae;
    --text-3: #8a8880;

    --primary-bg: #f1f0ec;
    --primary-text: #1b1b1a;
    --primary-bg-hover: #ffffff;

    --focus: #6ea4f4;
    --danger: #ee7468;
    --danger-bg: rgba(238, 116, 104, 0.13);
    --positive: #6fc18f;
    --positive-bg: rgba(111, 193, 143, 0.13);
    --info: #86b0ee;
    --info-bg: rgba(134, 176, 238, 0.13);

    --shadow-pop: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line-strong);
  }
}

@media (max-width: 820px) {
  :root {
    --gutter: 16px;
  }
}
