/* TRMNL warehouse-web look (Inter + indigo + gray) — shared by form/admin/me */
@import url("https://rsms.me/inter/inter.css");

:root {
  color-scheme: light;
  --font: InterVariable, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f9fafb;          /* gray-50 */
  --card: #ffffff;
  --ink: #111827;         /* gray-900 */
  --muted: #6b7280;       /* gray-500 */
  --line: #e5e7eb;        /* gray-200 */
  --accent: #4f46e5;      /* indigo-600 */
  --accent-hover: #6366f1;/* indigo-500 */
  --danger: #dc2626;
  --chip: #f3f4f6;        /* gray-100 */
  --ok-bg: #ecfdf5;
  --ok-ink: #047857;
  --err-bg: #fef2f2;
  --radius: 0.375rem;     /* rounded-md */
  --tap: 44px;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.shell { max-width: 56rem; margin: 0 auto; padding: 0.75rem 1rem 5.5rem; }
.shell.narrow { max-width: 28rem; } /* prefer .shell.week for avail */
.shell.wide { max-width: 40rem; }

.brand {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}
.brand img { height: 1.75rem; width: auto; }
.brand .title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.nav { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
.nav a { font-weight: 600; }

h1 {
  font-size: 1.05rem; font-weight: 600; margin: 0 0 0.25rem;
  color: var(--ink); letter-spacing: -0.01em;
}
.sub { color: var(--muted); font-size: 0.875rem; margin: 0 0 1rem; line-height: 1.4; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.row { margin-bottom: 1rem; }
.row:last-child { margin-bottom: 0; }
label.field {
  display: block; font-size: 0.875rem; font-weight: 500;
  color: var(--ink); margin-bottom: 0.375rem;
}
.hint { font-size: 0.75rem; color: var(--muted); margin: 0.375rem 0 0; }

input[type=text], input[type=password], input[type=week], input[type=number],
textarea, select {
  width: 100%; font-size: 0.95rem; font-family: inherit;
  padding: 0.5rem 0.75rem; min-height: var(--tap);
  border-radius: var(--radius);
  border: 1px solid #d1d5db;
  background: #fff; color: var(--ink);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.2);
}
#worker_code, #worker_code_me {
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.28em; text-align: center;
}
textarea { min-height: 3.5rem; resize: vertical; }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.seg button {
  min-height: var(--tap); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--chip);
  color: var(--ink); font-weight: 600; font-size: 0.875rem;
  font-family: inherit; padding: 0.5rem;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0.5rem 0.875rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 600;
  font-family: inherit; cursor: pointer; text-decoration: none;
  border: 0;
}
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary {
  background: #fff; color: var(--ink);
  box-shadow: var(--shadow);
  outline: 1px solid #d1d5db; outline-offset: -1px;
}
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-block { width: 100%; }
.btn-lg { min-height: 3.25rem; font-size: 1rem; font-weight: 700; border-radius: 0.5rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  border-radius: 999px; padding: 0.125rem 0.5rem;
  font-size: 0.75rem; font-weight: 500;
  background: #f9fafb; color: #4b5563;
  box-shadow: inset 0 0 0 1px rgb(107 114 128 / 0.1);
}
.badge.on {
  background: #ecfdf5; color: #047857;
  box-shadow: inset 0 0 0 1px rgb(4 120 87 / 0.2);
}
.badge.draft {
  background: #f9fafb; color: #4b5563;
}

.msg { display: none; margin-top: 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; }
.msg.ok { display: block; background: var(--ok-bg); color: var(--ok-ink); }
.msg.err { display: block; background: var(--err-bg); color: var(--danger); }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.blocks {
  width: 100%; border-collapse: collapse; font-size: 0.78rem; min-width: 360px;
}
table.blocks th, table.blocks td {
  border: 1px solid var(--line); padding: 0; text-align: center;
}
table.blocks th {
  background: var(--chip); font-weight: 600; color: var(--muted); padding: 0.5rem 0.25rem;
}
table.blocks th.corner { background: transparent; border: 0; }
table.blocks td button {
  width: 100%; min-height: 42px; border: 0; background: transparent;
  font-weight: 600; color: var(--muted); font-family: inherit; cursor: pointer;
}
table.blocks td button[aria-pressed="true"] {
  background: var(--accent); color: #fff;
}
.legend { font-size: 0.75rem; color: var(--muted); margin-top: 0.375rem; }

table.shifts { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
table.shifts th, table.shifts td {
  border-bottom: 1px solid var(--line); padding: 0.5rem 0.375rem; text-align: left;
}
table.shifts th {
  background: #f9fafb; color: var(--muted);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
table.shifts input, table.shifts select {
  min-height: 2.25rem; padding: 0.375rem; font-size: 0.8125rem;
}
table.shifts tr:nth-child(even) td { background: #f9fafb; }

.shift-card {
  border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 0.875rem; margin-top: 0.5rem; background: #fff;
}
.shift-card strong { display: block; margin-bottom: 0.125rem; font-size: 0.9375rem; }
.muted { color: var(--muted); font-size: 0.8125rem; }

.footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}
.footer-inner { max-width: 28rem; margin: 0 auto; }

.done { display: none; text-align: center; padding: 2rem 0.75rem; }
.done.show { display: block; }
.form.hidden { display: none; }
.done h2 { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.done p { color: var(--muted); margin: 0 0 1rem; font-size: 0.9rem; }
.linkish {
  background: none; border: 0; color: var(--accent); font-weight: 600;
  text-decoration: underline; padding: 0.5rem; font-family: inherit; cursor: pointer;
}

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; gap: 0.5rem;
}
.toolbar strong { font-size: 0.875rem; }

/* —— Schedule / me layout (demand → shifts) —— */
.page-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 0.25rem; }
.page-lede { color: var(--muted); font-size: 0.875rem; margin: 0 0 0.75rem; line-height: 1.45; }

.seg-toggle {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem;
  padding: 0.25rem; margin: 0 0 0.75rem;
  background: #f3f4f6; border-radius: 999px; border: 1px solid var(--line);
}
.seg-toggle button {
  min-height: 2.25rem; border: 0; border-radius: 999px;
  background: transparent; font-family: inherit; font-weight: 650; font-size: 0.8125rem;
  color: #4b5563; cursor: pointer;
}
.seg-toggle button[aria-pressed="true"] {
  background: #fff; color: var(--accent); box-shadow: var(--shadow);
}

.day-group { margin: 0.85rem 0 0.25rem; }
.day-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #9ca3af; margin: 0 0 0.35rem;
}

.shift-row {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 0.65rem;
  padding: 0.75rem; margin-top: 0.45rem; background: #fff;
}
.shift-row.mine { border-color: #a5b4fc; background: #eef2ff; }
.shift-time {
  flex: 0 0 4.5rem; font-size: 0.75rem; font-weight: 700; color: var(--accent);
  line-height: 1.25;
}
.shift-body { flex: 1; min-width: 0; }
.shift-body strong { display: block; font-size: 0.9375rem; letter-spacing: -0.01em; }
.shift-meta { color: var(--muted); font-size: 0.8125rem; margin-top: 0.15rem; }
.role-chip {
  display: inline-flex; align-items: center; margin-top: 0.35rem;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: #f3f4f6; color: #374151; font-size: 0.7rem; font-weight: 650;
}
.shift-row.mine .role-chip { background: #e0e7ff; color: #3730a3; }

.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 0.5rem 0.4rem; text-align: center;
}
.stat .n { display: block; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { font-size: 0.65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.code-pin {
  font-size: 1.35rem !important; font-weight: 700; letter-spacing: 0.28em; text-align: center;
}

.code-row { display: flex; gap: 0.5rem; align-items: end; }
.code-row .grow { flex: 1; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }
details.admin { margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
details.admin summary { cursor: pointer; font-weight: 600; }
.empty { color: var(--muted); font-size: 0.875rem; margin: 0.75rem 0; }
.chip-sub { display: block; font-weight: 500; opacity: 0.85; font-size: 0.65rem; }

/* —— Week plan grid —— */
.shell.roster { max-width: 52rem; }
.grid-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem; padding: 0 0.25rem 0.25rem;
}
table.week-grid {
  width: 100%; min-width: 36rem; border-collapse: separate; border-spacing: 0;
  font-size: 0.72rem; background: #fff; border: 1px solid var(--line);
  border-radius: 0.65rem; overflow: hidden;
}
table.week-grid th, table.week-grid td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  vertical-align: top; padding: 0.35rem;
}
table.week-grid th:last-child, table.week-grid td:last-child { border-right: 0; }
table.week-grid tr:last-child td { border-bottom: 0; }
table.week-grid thead th {
  background: #f9fafb; color: #111827; font-weight: 650;
  text-align: center; padding: 0.45rem 0.2rem; font-size: 0.65rem;
  letter-spacing: -0.01em; line-height: 1.15;
}
table.week-grid thead th .dnum { display: none; }
table.week-grid .row-label {
  width: 4.25rem; background: #f9fafb; color: #4b5563; font-weight: 700;
  font-size: 0.68rem; text-align: left; padding: 0.45rem 0.4rem;
}
table.week-grid .row-label .t { display: block; color: #9ca3af; font-weight: 500; margin-top: 0.1rem; }
table.week-grid td.cell { min-height: 4.5rem; height: 1%; background: #fff; }
table.week-grid td.cell.empty-cell { background: #fcfcfd; }
.cell-stack { display: flex; flex-direction: column; gap: 0.25rem; min-height: 3.25rem; }
.cell-chip {
  display: block; border-radius: 0.35rem; padding: 0.28rem 0.35rem;
  background: #f3f4f6; color: #1f2937; font-weight: 650; line-height: 1.2;
  border: 1px solid transparent;
}
.cell-chip.mine {
  background: #eef2ff; border-color: #a5b4fc; color: #3730a3;
}
.cell-chip .role { display: block; font-size: 0.62rem; font-weight: 600; color: #6b7280; margin-top: 0.1rem; }
.cell-chip.mine .role { color: #6366f1; }

.brief-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; }
.brief {
  border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
}
.brief h3 { margin: 0 0 0.35rem; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.brief .when { color: #4f46e5; font-size: 0.78rem; font-weight: 700; margin-bottom: 0.45rem; }
.brief .task { font-size: 0.875rem; margin: 0 0 0.5rem; color: #111827; }
.brief .goals { margin: 0; padding-left: 1.1rem; color: #374151; font-size: 0.8125rem; }
.brief .goals li { margin: 0.15rem 0; }
.sec-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #9ca3af; margin: 1rem 0 0.4rem;
}


/* —— Structure polish (Linear/Todoist clarity) + WHWEB look (Inter + indigo) —— */
/* Keep warehouse tokens from :root above. Only calm hierarchy / spacing here. */

.shell { padding: 1rem 1rem 5.5rem; }
.shell.roster { max-width: 52rem; }

.app-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.65rem 0 0.15rem;
  margin: -0.15rem 0 0.65rem;
}

.brand { margin: 0 0 0.65rem; gap: 0.55rem; }
.brand img { height: 1.5rem; }
.brand .title {
  font-size: 0.9375rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink);
}

/* Worker nav: two equal tabs. Admin is a footer link, not a peer tab. */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0 0 1rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  width: 100%;
}
.tabs a {
  display: flex; align-items: center; justify-content: center;
  min-height: 2.5rem; padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem; font-weight: 600;
  color: #4b5563; text-decoration: none; text-align: center;
  line-height: 1.15; background: transparent; box-shadow: none;
  border-bottom: 0; margin-bottom: 0;
  width: 100%; min-width: 0; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); background: #e5e7eb; text-decoration: none; }
.tabs a.active,
.tabs a[aria-current="page"] {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow);
  border-bottom: 0;
}
.tabs a.active:hover,
.tabs a[aria-current="page"]:hover { color: var(--accent); background: #fff; }

.admin-foot {
  margin: 2.25rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.admin-foot a { color: #9ca3af; text-decoration: none; }
.admin-foot a:hover { color: #6b7280; text-decoration: underline; }

.admin-back {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.admin-back a { color: #9ca3af; text-decoration: none; }
.admin-back a:hover { color: #6b7280; text-decoration: underline; }

.page-title {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em;
  margin: 0 0 0.25rem; color: var(--ink);
}
.page-lede {
  color: var(--muted); font-size: 0.875rem;
  margin: 0 0 1rem; line-height: 1.45; max-width: 36rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

label.field { font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
input, textarea, select {
  border-color: #d1d5db; border-radius: var(--radius);
  font-size: 0.9375rem;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.2);
}

.code-pin {
  font-size: 1.25rem !important; font-weight: 700;
  letter-spacing: 0.28em; text-align: center;
}

/* Quiet meta (Todoist-like density) — WHWEB ink */
.stat-row, .stats-row {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.1rem;
  margin: 0 0 0.75rem; padding: 0; background: transparent; border: 0;
}
.stat {
  background: transparent; border: 0; padding: 0; text-align: left;
  display: flex; align-items: baseline; gap: 0.3rem;
}
.stat .n { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.stat .l { font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* Week switcher: select + arrows (not a second tab bar) */
/* week-chips visible — clickable KW picker */
.week-bar {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 0 0 0.55rem;
}
.week-nav {
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
  font-size: 1.15rem; line-height: 1; color: var(--ink);
  cursor: pointer; font-family: inherit; font-weight: 600;
}
.week-nav:hover:not(:disabled) { background: #f9fafb; border-color: #d1d5db; }
.week-nav:disabled { opacity: 0.35; cursor: default; }
.week-select-wrap { flex: 1; min-width: 0; }
.week-select-wrap select {
  width: 100%; min-height: 2.5rem; font-size: 0.875rem; font-weight: 600;
  border: 1px solid #d1d5db; border-radius: var(--radius);
  background: #fff; padding: 0.4rem 0.65rem; color: var(--ink);
}
.meta-line {
  margin: 0 0 0.85rem; font-size: 0.8125rem; color: var(--muted);
  font-weight: 500; line-height: 1.4;
}
.meta-line.muted { color: #9ca3af; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Grid + chips: indigo mine (WHWEB), quiet rest */
.grid-scroll { margin: 0 0 1.1rem; }
table.week-grid {
  width: 100%; min-width: 36rem; border-collapse: separate; border-spacing: 0;
  font-size: 0.72rem; background: #fff; border: 1px solid var(--line);
  border-radius: 0.5rem; overflow: hidden;
}
table.week-grid thead th {
  background: #f9fafb; color: var(--ink); font-weight: 650;
  text-align: center; padding: 0.5rem 0.25rem; font-size: 0.68rem;
}
table.week-grid .row-label {
  width: 4.5rem; background: #f9fafb; color: #4b5563; font-weight: 700;
  font-size: 0.68rem; text-align: left; padding: 0.45rem 0.4rem;
}
table.week-grid .row-label .t { display: block; color: #9ca3af; font-weight: 500; margin-top: 0.1rem; }
table.week-grid td.cell { min-height: 4rem; padding: 0.3rem; vertical-align: top; }
table.week-grid td.cell.empty-cell { background: #fcfcfd; }
.cell-stack { display: flex; flex-direction: column; gap: 0.22rem; min-height: 3rem; }
.cell-chip {
  display: block; border-radius: 0.35rem; padding: 0.28rem 0.35rem;
  background: #f3f4f6; color: #1f2937; font-weight: 650; line-height: 1.2;
  border: 1px solid transparent;
}
.cell-chip.mine {
  background: #eef2ff; border-color: #a5b4fc; color: #3730a3;
}
.cell-chip .role { display: block; font-size: 0.62rem; font-weight: 600; color: #6b7280; margin-top: 0.1rem; }
.cell-chip.mine .role { color: #4f46e5; }

.sec-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #9ca3af; margin: 0.25rem 0 0.5rem;
}
.brief-list { display: flex; flex-direction: column; gap: 0.5rem; }
.brief {
  border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 0.5rem;
  padding: 0.75rem 0.85rem;
}
.brief .when { color: #4f46e5; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.35rem; }
.brief h3 { margin: 0 0 0.35rem; font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.brief .task { font-size: 0.875rem; margin: 0 0 0.45rem; color: #111827; line-height: 1.4; }
.brief .goals { margin: 0; padding-left: 1.1rem; color: #374151; font-size: 0.8125rem; }
.brief .goals li { margin: 0.12rem 0; }

.footer {
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}


/* —— Shared week matrix (Verfügbarkeit + Schichten): days = columns —— */
.shell.week,
.shell.roster { max-width: 52rem; }

.grid-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0.25rem 0 0.35rem;
}

table.blocks.week-matrix,
table.week-grid {
  width: 100%; min-width: 36rem; border-collapse: separate; border-spacing: 0;
  font-size: 0.72rem; background: #fff; border: 1px solid var(--line);
  border-radius: 0.5rem; overflow: hidden;
}
table.blocks.week-matrix th,
table.blocks.week-matrix td,
table.week-grid th,
table.week-grid td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 0.3rem; vertical-align: middle; text-align: center;
}
table.blocks.week-matrix th:last-child,
table.blocks.week-matrix td:last-child,
table.week-grid th:last-child,
table.week-grid td:last-child { border-right: 0; }
table.blocks.week-matrix tr:last-child td,
table.blocks.week-matrix tr:last-child th,
table.week-grid tr:last-child td { border-bottom: 0; }

table.blocks.week-matrix thead th,
table.week-grid thead th {
  background: #f9fafb; color: var(--ink); font-weight: 650;
  padding: 0.5rem 0.25rem; font-size: 0.68rem;
}
table.blocks.week-matrix thead th.corner,
table.week-grid thead th:first-child {
  background: #f9fafb; border-bottom: 1px solid var(--line);
}
table.blocks.week-matrix .dnum,
table.week-grid .dnum { font-weight: 700; letter-spacing: -0.01em; }

table.blocks.week-matrix .row-label,
table.week-grid .row-label {
  width: 5.25rem; background: #f9fafb; color: #4b5563; font-weight: 700;
  font-size: 0.68rem; text-align: left; padding: 0.45rem 0.4rem;
}
table.blocks.week-matrix .row-label .t,
table.week-grid .row-label .t {
  display: block; color: #9ca3af; font-weight: 500; margin-top: 0.1rem;
}

table.blocks.week-matrix td button {
  width: 100%; min-height: 2.75rem; border: 0; border-radius: 0.35rem;
  background: #f3f4f6; color: #9ca3af; font-weight: 700; font-size: 0.95rem;
  font-family: inherit; cursor: pointer;
}
table.blocks.week-matrix td button:hover { background: #e5e7eb; color: var(--ink); }
table.blocks.week-matrix td button[aria-pressed="true"] {
  background: var(--accent); color: #fff;
}

/* Team demand — general pack-plan need, not /me-only */
.demand-banner {
  display: none;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.demand-banner.show { display: block; }
.demand-banner strong { font-weight: 700; letter-spacing: -0.01em; }
.demand-banner .sub {
  display: block; margin-top: 0.2rem;
  color: #4338ca; font-weight: 500; font-size: 0.75rem;
}
.demand-banner.empty {
  background: #f9fafb; border-color: var(--line); color: var(--muted);
}
.demand-banner.empty .sub { color: var(--muted); }

/* Cadence deadline strip */
.deadline-banner {
  display: none;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}
.deadline-banner.show { display: block; }
.deadline-banner.late {
  border-color: #fecaca; background: #fef2f2; color: #991b1b;
}
.deadline-banner.today {
  border-color: #fdba74; background: #fff7ed; color: #9a3412;
}

.hint, #week_horizon {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  font-weight: 500;
  line-height: 1.35;
}


/* Clickable week chips (not dropdown) */
.week-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.25rem 0 0;
}
@media (min-width: 480px) {
  .week-chips { grid-template-columns: repeat(4, 1fr); }
}
.week-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  text-align: left;
  min-height: 3.25rem; padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  color: var(--ink, #111827);
  font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow, 0 1px 2px rgb(0 0 0 / 0.05));
}
.week-chip:hover { border-color: #c7d2fe; background: #f8fafc; }
.week-chip.active {
  border-color: var(--accent, #4f46e5);
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgb(79 70 229 / 0.2);
}
.week-chip .kw { font-size: 0.875rem; font-weight: 700; letter-spacing: -0.02em; }
.week-chip .range { font-size: 0.7rem; font-weight: 500; color: var(--muted, #6b7280); }
.week-chip.active .range { color: #4338ca; }
.week-chip .tag {
  font-size: 0.65rem; font-weight: 650; color: var(--accent, #4f46e5);
  text-transform: lowercase;
}
.week-chip.active .tag { color: #3730a3; }

.week-bar { display: none !important; } /* replaced by .week-chips */


/* Identity: compact under tabs, not a mid-page card */
.identity-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}
.identity-in, .identity-out {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.identity-in[hidden], .identity-out[hidden] { display: none !important; }
.identity-bar .code-pin {
  width: 8.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-align: center;
  font-weight: 600;
}
.identity-chip {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--text, #0f172a);
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border, #e2e8f0);
  color: var(--muted, #64748b);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text, #0f172a); border-color: #cbd5e1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

