/* The KitCut app look, shared by the Studio (/studio, projects.html) and the account page
   (/account): colours, type, buttons, the bar with its account menu, the sidebar, panels, forms,
   banners, dialogs and the sign-in panel. Page-only styles stay in each page. */
@font-face { font-family: 'Caveat'; src: url(/fonts/Caveat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/Inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
/* The workspace: KitCut's orange on warm neutrals, for the actions only. Light and dark follow
   the device, as on the rest of the site (and data-theme, where a host sets one). */
:root {
  --bg: #f5f3ef; --panel: #ffffff; --side: #efebe5; --sunk: #f1ede7; --hover: #e9e4dc;
  --ink: #1d1a17; --ink-2: #5d564e; --ink-3: #8a8279;
  --line: #e5e0d8; --line-2: #d4cdc2;
  --accent: #d9733f; --accent-2: #c3602c; --accent-ink: #ffffff; --accent-soft: #fbeadf;
  --good: #2f7a47; --good-soft: #e2f0e6; --bad: #b3412e; --bad-soft: #f8e4df;
  --paper: #ffffff; --check: #ece8e2; --seg-on: #ffffff;
  --ring: 0 0 0 3px rgba(217, 115, 63, .3);
  --lift: 0 1px 2px rgba(29, 26, 23, .06), 0 8px 24px rgba(29, 26, 23, .08);
  --dialog: 0 24px 64px rgba(29, 26, 23, .24);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210; --panel: #1c1a17; --side: #181613; --sunk: #211e1a; --hover: #26221e;
    --ink: #f3eee7; --ink-2: #b6aea3; --ink-3: #867e74;
    --line: #2c2824; --line-2: #3b3630;
    --accent: #e5894f; --accent-2: #f09c68; --accent-ink: #1a120c; --accent-soft: #3a2518;
    --good: #6cc189; --good-soft: #1b2e22; --bad: #ec8a74; --bad-soft: #3a201a;
    --check: #d9d4cc; --seg-on: #3a352f;
    --lift: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .4);
    --dialog: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141210; --panel: #1c1a17; --side: #181613; --sunk: #211e1a; --hover: #26221e;
  --ink: #f3eee7; --ink-2: #b6aea3; --ink-3: #867e74;
  --line: #2c2824; --line-2: #3b3630;
  --accent: #e5894f; --accent-2: #f09c68; --accent-ink: #1a120c; --accent-soft: #3a2518;
  --good: #6cc189; --good-soft: #1b2e22; --bad: #ec8a74; --bad-soft: #3a201a;
  --check: #d9d4cc; --seg-on: #3a352f;
  --lift: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .4);
  --dialog: 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger.sure { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.icon { width: 36px; padding: 0; }

/* ---- the shell: a bar, a sidebar of projects, the work */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.brand b { font: 700 26px/1 Caveat, cursive; letter-spacing: .2px; }
.brand .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; }
.brand span { font-weight: 600; font-size: 15px; color: var(--ink-2); }
.bar .grow { flex: 1; }
.credits { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 13px; text-decoration: none; }
.credits b { color: var(--ink); font-weight: 600; }
.me { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--accent-soft); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu { position: absolute; right: 0; top: 40px; min-width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--lift); padding: 6px; display: grid; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu form { margin: 0; display: grid; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100% - 56px); }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.side .label { padding: 6px 10px; }
.side a.item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.side a.item:hover { background: var(--hover); color: var(--ink); }
.side a.item.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.side a.item .n { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.side a.item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .new { margin-top: 6px; justify-content: flex-start; background: transparent; border-style: dashed; color: var(--ink-2); }
.side .foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.side .foot a { color: var(--ink-3); }
.swatch { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; }

.main { min-width: 0; padding: 28px 32px 48px; }
.page { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
#tabBody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.phone-nav { display: none; }
.legal { max-width: 1180px; margin: 40px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.legal a { color: var(--ink-3); }

/* ---- headings */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.head h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 650; letter-spacing: -.015em; text-wrap: balance; }
.head p { margin: 4px 0 0; max-width: 64ch; color: var(--ink-2); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.chip.accent { background: var(--accent-soft); color: var(--ink); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.brief { margin: 8px 0 0; color: var(--ink-2); max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }

.banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 13.5px; }
.banner .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
/* ---- panels and forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.say { margin: 0; font-size: 13px; color: var(--ink-2); }
.say.bad { color: var(--bad); }
.say.count { margin-top: -6px; text-align: right; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--ink-3); font-size: 12.5px; }
.input, textarea.input { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); padding: 9px 11px; font-size: 14px; }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.55; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.empty { padding: 40px 24px; display: grid; justify-items: center; text-align: center; gap: 10px; }
.empty .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .ico svg { width: 22px; height: 22px; }
.empty h2 { margin: 4px 0 0; font-size: 17px; font-weight: 650; }
.empty p { margin: 0; max-width: 52ch; color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, var(--sunk), var(--hover), var(--sunk)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 650; }

/* dialogs */
dialog { border: 0; padding: 0; border-radius: 14px; background: var(--panel); color: var(--ink); box-shadow: var(--dialog); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(20, 18, 16, .5); backdrop-filter: blur(2px); }
dialog .dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
dialog .dhead h2 { margin: 0; font-size: 16px; font-weight: 650; }
dialog .dbody { padding: 20px; display: grid; gap: 16px; }
dialog .dfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--sunk); border-radius: 0 0 14px 14px; }
.signin { max-width: 440px; margin: 8vh auto 0; padding: 28px; display: grid; gap: 14px; }
.signin h1 { margin: 0; font-size: 22px; font-weight: 650; }
.signin p { margin: 0; color: var(--ink-2); }
.signin .or { text-align: center; color: var(--ink-3); font-size: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 16px 16px 40px; }
  .phone-nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--side); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .phone-nav a { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 550; color: var(--ink-2); }
  .phone-nav a.on { color: var(--ink); border-color: var(--accent); }
  .phone-nav a .swatch { width: 20px; height: 20px; border-radius: 50%; font-size: 10px; }
  .phone-nav a.plain { padding-left: 12px; }
  .brand .sep, .brand span, .bar .home span { display: none; }
}
@media (max-width: 460px) {
  .credits span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
