/* Layout of the work app, after the studio site (29.09.2026). Colours, fonts
   and radii come from brand.css; nothing here names a colour of its own.
   Ordered by component, then by screen. */

/* --- base ---------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 40px 0; }
.loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* --- header: a dark glass bar across the page, as on the site ------------------- */
.top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px; height: 76px;
  padding: 0 max(24px, calc((100% - var(--page)) / 2));
  background: var(--bar); -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
}
.logo { display: block; flex-shrink: 0; line-height: 0; }
/* The studio site's header logo, at the site's size. */
.logo img { width: 63px; height: 55px; }
.pills {
  display: flex; align-items: center; gap: 30px; margin: 0 auto; padding: 8px 20px;
  border: 1px solid var(--hint); border-radius: 30px;
}
.pills:empty { visibility: hidden; }
.pill {
  text-decoration: none; white-space: nowrap; text-transform: uppercase;
  font-size: 15px; transition: color .15s;
}
.pill:hover, .pill.on { color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who button {
  background: none; border: 1px solid var(--hint); border-radius: var(--radius-pill); cursor: pointer;
  min-height: 36px; padding: 6px 18px; font-size: 13px; text-transform: uppercase; color: var(--text);
}
.who button:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

.view { max-width: calc(var(--page) + 48px); margin: 0 auto; padding: 40px 24px 100px; }

/* --- type ------------------------------------------------------------------------ */
.kicker { font-size: 12px; line-height: 1.4; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.title {
  margin: 10px 0 30px; font-weight: 700; font-size: clamp(34px, 6vw, 72px); line-height: .95;
  letter-spacing: -.04em; text-transform: uppercase; overflow-wrap: anywhere;
}
.h2 { margin: 0 0 16px; font-weight: 400; font-size: 20px; line-height: 1.2; text-transform: uppercase; }
.code-line { margin: -20px 0 28px; }
.quote { font-style: italic; white-space: pre-wrap; }
/* Which episode of which project: the first thing on every card (owner, 29.09). */
.place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; line-height: 1.35; }
.place-where { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.place-name { color: var(--text); }
.place-code { color: var(--muted); font-size: 12px; }
h1 + .place, .back + .place { margin-bottom: 4px; }

/* --- switchers: filter chips and project pills are the site's outline pills ------- */
.chips, .project-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: -10px 0 30px; }
.project-pills { padding: 0; border: 0; width: auto; }
.chip, .project-pills .pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 18px; cursor: pointer;
  border: 1px solid var(--hint); border-radius: var(--radius-pill); background: transparent; color: var(--text);
  font-size: 12px; text-transform: uppercase; letter-spacing: .02em; transition: background .15s, color .15s;
}
.chip:hover, .project-pills .pill:hover,
.chip.on, .project-pills .pill.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-n { margin-left: 8px; opacity: .6; }

/* --- buttons ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start;
  min-height: 40px; padding: 8px 24px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--radius-btn);
  font-size: 13px; text-transform: uppercase; letter-spacing: .02em; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost, .btn-warn { background: transparent; border-color: var(--hint); color: var(--text); }
.btn-ghost:hover, .btn-warn:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-warn { border-color: var(--st-notes); color: var(--st-notes); }
.btn-small { min-height: 30px; padding: 4px 14px; font-size: 11px; }
a.btn { margin-bottom: 0; }

/* --- inputs: an underline, as in the site's form ------------------------------------ */
input[type=url], input[type=text], input[type=date], select, textarea {
  width: 100%; padding: 10px 0; outline: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--text); transition: border-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--hint); opacity: 1; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--accent); }
select { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 22px;
  background: linear-gradient(45deg, transparent 50%, var(--hint) 50%) right 6px center / 6px 6px no-repeat,
              linear-gradient(-45deg, transparent 50%, var(--hint) 50%) right 0 center / 6px 6px no-repeat; }
select option { background: var(--card); color: var(--text); }
input[type=date] { color-scheme: dark; }
textarea { resize: vertical; min-height: 80px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
label.kicker { display: block; margin-top: 8px; }

.note { font-size: 13px; color: var(--muted); }
.note.ok { color: var(--st-done); }
.note.err { color: var(--st-notes); }

/* --- surfaces ------------------------------------------------------------------------ */
.panel, .card, .icard, .counter {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
/* The site's faint ring in the corner of a tile. */
.card::after, .counter::after {
  content: ""; position: absolute; width: 270px; height: 270px; right: -110px; bottom: -170px;
  border: 1px solid var(--ring); border-radius: 50%; pointer-events: none;
}
.counter::after { right: -130px; bottom: -215px; }
.panel { padding: 24px 26px; }
.panel + .panel { margin-top: 16px; }
.panel .h2 { font-size: 16px; }

/* --- statuses ------------------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 3px 11px; border: 1px solid currentColor; border-radius: var(--radius-pill);
  font-size: 10px; line-height: 1.5; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.st-new { color: var(--st-new); }
.st-waiting { color: var(--st-waiting); }
.st-issued { color: var(--st-issued); }
.st-review { color: var(--st-review); }
.st-notes { color: var(--st-notes); }
.st-done { color: var(--st-done); }
.c-late { color: var(--st-notes); }
.c-check { color: var(--st-review); }
.c-issue { color: var(--accent); }
.c-notes { color: var(--st-waiting); }
.c-submit { color: var(--muted); }
.due { font-size: 13px; color: var(--muted); }
.due.late { color: var(--st-notes); }

/* --- counters: the site's big facts ------------------------------------------------------ */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 36px; }
.counter { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 20px 24px 22px; min-height: 150px; }
.counter .n { display: none; }
.counter .num { font-weight: 700; font-size: clamp(56px, 6vw, 88px); line-height: .9; letter-spacing: -.07em; }
.counter .label { margin-top: 10px; font-weight: 700; font-size: 13px; text-transform: uppercase; }

/* --- task cards (my tasks, reviews, episodes) --------------------------------------------- */
.project { margin-bottom: 50px; }
.project-title {
  margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.group { margin-bottom: 36px; }
.group-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-weight: 700; font-size: 20px; text-transform: uppercase; }
.group-count { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; min-height: 150px; text-decoration: none; transition: background .2s; }
a.card:hover { background: var(--tile-hi); }
.card .kind { font-weight: 700; font-size: 16px; text-transform: uppercase; line-height: 1.2; }
.card .brief { color: var(--muted); font-size: 14px; white-space: pre-wrap; }

/* --- inbox: what is waiting for me --------------------------------------------------------- */
.isection { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.isection-title { margin: 0 0 4px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.icard { display: flex; gap: 24px; align-items: center; padding: 20px 24px; }
.icard.late { border-color: var(--st-notes); }
.icard.fresh { border-color: var(--accent); }
a.icard { text-decoration: none; color: inherit; margin-bottom: 10px; transition: background .2s; }
a.icard:hover { background: var(--tile-hi); }
.icard-main { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.icard .kind { font-weight: 700; font-size: 17px; line-height: 1.2; text-transform: uppercase; }
.icard-main .brief { color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.icard-side { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.issue-side { flex-wrap: wrap; max-width: 560px; gap: 14px; }
.issue-side select { width: 200px; }
.issue-side input[type=date] { width: 150px; }
.more { color: var(--muted); font-size: 14px; }
.more-sheets { display: flex; flex-direction: column; gap: 8px; }
.more-link { color: var(--text); font-size: 14px; text-transform: uppercase; text-decoration: none; }
.more-link:hover { color: var(--accent); }

/* --- due date: quick picks ------------------------------------------------------------------ */
.duefield { display: flex; flex-direction: column; gap: 6px; }
.dchips { display: flex; flex-wrap: wrap; gap: 6px; }
.dchip {
  padding: 5px 12px; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: transparent; color: var(--text); font-size: 12px; transition: background .15s, color .15s;
}
.dchip:hover, .dchip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.due-label { font-size: 13px; color: var(--muted); }

/* --- one task, one review, issuing -------------------------------------------------------------- */
.back { display: inline-block; margin-bottom: 20px; color: var(--muted); text-decoration: none; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.back:hover { color: var(--accent); }
.task-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field .kicker { margin-bottom: 6px; }
.field .value { white-space: pre-wrap; }
form.submit { display: flex; flex-direction: column; gap: 14px; }
form.panel { margin: 0 0 24px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.history li:first-child { border-top: 0; padding-top: 0; }
.link { word-break: break-all; font-size: 13px; }

/* --- login ------------------------------------------------------------------------------------- */
.login { display: flex; flex-direction: column; gap: 16px; max-width: 460px; margin: 10vh auto 0; padding: 32px 34px; }
.login .title { font-size: clamp(30px, 5vw, 44px); margin: 0; }

/* --- the episode sheet: the one wide page -------------------------------------------------------- */
.view:has(.sheet) { max-width: 1488px; }
.bulk {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 16px 0; padding: 14px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-ghost);
}
.bulk select { width: 200px; }
.bulk input[type=date] { width: 150px; }
.sheet { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.srow {
  display: grid; min-width: 1120px; gap: 10px; align-items: start; padding: 10px 16px; font-size: 13px;
  grid-template-columns: 28px 40px minmax(130px, 1fr) 150px minmax(110px, 1fr) minmax(160px, 2fr) 150px 140px 120px 90px;
  border-top: 1px solid var(--line-soft);
}
.srow:nth-child(even) { background: var(--row-alt); }
.srow.picked { background: var(--accent-ghost); }
.srow > :nth-child(4) { overflow-wrap: anywhere; }
.srow select, .srow input[type=date] { padding: 4px 0; font-size: 13px; }
.srow select { padding-right: 20px; }
.srow .clip { color: var(--muted); white-space: pre-wrap; }
.shead {
  border-top: 0; background: var(--card) !important; padding: 14px 16px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}

/* --- overview ----------------------------------------------------------------------------------- */
.age { width: 70px; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 26px; letter-spacing: -.05em; line-height: 1; }
.bar { display: flex; flex: 1; height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: var(--bg-deep); }
.bar-part { height: 8px; }
.ready { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px 12px; }
.ready-project { margin-bottom: 18px; }
.ready-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.load { display: grid; grid-template-columns: 140px minmax(0, 1fr) 90px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; }

/* --- phones -------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .top { flex-wrap: wrap; height: auto; gap: 10px 12px; padding: 10px 16px 12px; }
  .logo img { width: 46px; height: 40px; }
  .who { margin-left: auto; }
  .who span { display: none; }
  .pills {
    order: 3; width: 100%; margin: 0; gap: 14px; padding: 8px 14px;
    overflow-x: auto; scrollbar-width: none;
  }
  .pills::-webkit-scrollbar { display: none; }
  .pill { font-size: 11px; letter-spacing: 0; }
  .who button { min-height: 30px; padding: 4px 12px; font-size: 11px; }
  .view { padding: 24px 16px 70px; }
  .task-grid { grid-template-columns: 1fr; }
  .icard { flex-direction: column; align-items: stretch; gap: 16px; }
  .icard-side { flex-wrap: wrap; }
  .issue-side select, .issue-side input[type=date] { width: 100%; }
  .counter { min-height: 120px; }
  .login { margin-top: 4vh; padding: 24px; }
}

/* --- test mode: a bar that never lets one forget it is on (owner, 30.09) ------------------------- */
.logo:has(.app-name) { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.app-name { font-size: 12px; line-height: 1.2; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) { .app-name { display: none; } }
.testbar {
  position: sticky; top: 76px; z-index: 99;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  padding: 12px max(24px, calc((100% - var(--page)) / 2));
  background: #3a2f12; border-bottom: 1px solid var(--st-waiting); font-size: 13px;
}
.testbar strong { color: var(--st-waiting); }
.testbar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.testbar .chip { padding: 4px 12px; }
.testbar select { width: auto; padding: 4px 0; }
.testbar .chip-off { border-color: var(--st-waiting); color: var(--st-waiting); }
.who .test-on { border-color: var(--st-waiting); color: var(--st-waiting); }
@media (max-width: 760px) {
  .testbar { position: static; padding: 10px 16px; }
}
