:root {
  color-scheme: light;
  --ink: #18332f;
  --ink-strong: #0d2824;
  --muted: #667a76;
  --line: #d8ddd7;
  --surface: #fffefa;
  --canvas: #f4f1eb;
  --green: #1e6e5c;
  --green-soft: #e5f1ec;
  --orange: #ea6f3a;
  --orange-soft: #fff0e7;
  --red: #b94343;
  --shadow: 0 22px 60px rgba(30, 50, 45, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.worker-calendar-panel {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.worker-calendar-panel .panel-heading {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-controls button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.calendar-weekdays,
.worker-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid var(--line);
  background: #fafaf7;
}

.calendar-weekdays span {
  padding: 8px 4px;
  color: var(--muted);
  font-size: .63rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.worker-calendar-day {
  min-height: 104px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.worker-calendar-day:nth-child(7n) { border-right: 0; }
.worker-calendar-day.is-outside { background: #fafaf7; color: #a2aaa6; }
.worker-calendar-day > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 850;
}
.worker-calendar-day.is-today > span { background: var(--green); color: #fff; }
.worker-calendar-day > div { display: grid; gap: 4px; margin-top: 6px; }
.worker-calendar-day button {
  width: 100%;
  overflow: hidden;
  padding: 4px 5px;
  border: 0;
  border-left: 3px solid var(--green);
  border-radius: 4px;
  background: #edf5f2;
  color: var(--ink);
  font-size: .6rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.worker-calendar-day button.is-attention { border-color: #d28d34; background: #fff5e4; }
.worker-calendar-day small { color: var(--muted); font-size: .58rem; }

@media (max-width: 680px) {
  .worker-calendar-day { min-height: 72px; padding: 4px; }
  .worker-calendar-day button { font-size: .52rem; padding: 3px; }
  .calendar-weekdays span { font-size: .52rem; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0 0, rgba(234, 111, 58, 0.08), transparent 30rem),
    var(--canvas);
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.worker-shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  border-bottom: 1px solid rgba(24, 51, 47, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 0.95rem; }
.brand small { color: var(--muted); font-weight: 700; }

.topbar nav { display: flex; gap: 8px; }
.topbar nav a, .topbar nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.topbar svg { width: 16px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

.worker-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.72fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 70px 5vw;
}

.gate-copy h1 {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--ink-strong);
  font-size: clamp(3.1rem, 6.5vw, 6.8rem);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 0.97;
}

.gate-copy > p:not(.eyebrow) {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.6;
}

.gate-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.gate-rules span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(30, 110, 92, 0.18);
  border-radius: 999px;
  background: rgba(229, 241, 236, 0.72);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
}
.gate-rules svg { width: 16px; }

.gate-card {
  display: grid;
  gap: 12px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-help-link {
  width: fit-content;
  color: var(--green);
  font-size: .73rem;
  font-weight: 800;
  text-decoration: none;
}

.gate-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}

.gate-card h2 { margin-bottom: 18px; color: var(--ink-strong); font-size: 1.7rem; }
.gate-card label, .field-grid label > span { color: var(--ink-strong); font-size: 0.8rem; font-weight: 850; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink-strong);
  outline: none;
}
input, select { min-height: 48px; padding: 0 13px; }
textarea { padding: 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 110, 92, 0.12); }

.primary-button, .secondary-button, .record-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 19px;
  font-weight: 900;
}
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.record-button { border: 1px solid #cc4d2e; background: #cc4d2e; color: white; }
.primary-button svg, .secondary-button svg, .record-button svg { width: 17px; }
button:disabled { cursor: wait; opacity: 0.58; }

.form-error { margin: 2px 0 0; color: var(--red); font-size: 0.86rem; font-weight: 750; }

.worker-workspace { padding-top: 52px; }

.workspace-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 0 34px;
}

.workspace-hero h1 {
  margin-bottom: 12px;
  color: var(--ink-strong);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 520;
  letter-spacing: -0.05em;
  line-height: 1;
}

.workspace-hero p:last-child { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

.status-line {
  display: block;
  min-height: 28px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}
.status-line.is-error { color: var(--red); }

.master-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid rgba(30, 110, 92, 0.2);
  border-radius: 20px;
  background: linear-gradient(110deg, #eef6f2, #fffefa 70%);
}

.sync-orbit {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(30, 110, 92, 0.12);
}
.sync-orbit svg { width: 21px; }
.sync-orbit span {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid white;
  border-radius: 50%;
  background: #33a276;
}

.master-strip .eyebrow { margin-bottom: 3px; }
.master-strip strong, .master-strip div > span { display: block; }
.master-strip div > span { margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.master-strip > a { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 0.85rem; font-weight: 900; text-decoration: none; }
.master-strip > a svg { width: 16px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric-card {
  min-height: 124px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
}
.metric-card span { display: block; color: var(--muted); font-size: 0.77rem; font-weight: 850; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 12px; color: var(--ink-strong); font-size: 2.2rem; font-weight: 620; letter-spacing: -0.04em; }
.metric-card small { display: block; margin-top: 2px; color: var(--muted); }
.metric-card.is-attention { border-color: rgba(234, 111, 58, 0.35); background: var(--orange-soft); }

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.work-panel, .side-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.work-panel { padding: 24px; }
.side-stack { display: grid; align-content: start; gap: 18px; }
.side-panel { padding: 21px; }

.panel-heading, .side-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-heading h2, .side-panel h2 { margin-bottom: 0; color: var(--ink-strong); font-size: 1.35rem; }
.side-panel header > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}
.side-panel header > svg { width: 21px; color: var(--green); }

.segmented-filter { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--canvas); }
.segmented-filter button { min-height: 30px; border: 0; border-radius: 999px; padding: 0 11px; background: transparent; color: var(--muted); font-size: 0.76rem; font-weight: 850; }
.segmented-filter button.is-active { background: var(--surface); color: var(--ink-strong); box-shadow: 0 1px 5px rgba(20, 40, 35, 0.12); }

.assignment-list { display: grid; gap: 10px; }
.assignment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}
.number-token { display: grid; min-width: 96px; gap: 4px; }
.number-token strong { color: var(--ink-strong); font-size: 0.95rem; }
.status-chip {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}
.status-chip.is-orange { background: var(--orange-soft); color: #a44724; }
.assignment-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.assignment-detail span { display: grid; gap: 3px; color: var(--muted); font-size: 0.75rem; }
.assignment-detail strong { overflow: hidden; color: var(--ink); font-size: 0.87rem; text-overflow: ellipsis; white-space: nowrap; }
.assignment-card > button, .available-row button {
  min-height: 37px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.available-panel > p { margin: -4px 0 17px; color: var(--muted); font-size: 0.83rem; line-height: 1.45; }
.available-list, .feedback-list { display: grid; gap: 8px; }
.available-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.available-row div { display: grid; gap: 2px; }
.available-row strong { color: var(--ink-strong); font-size: 0.86rem; }
.available-row span { color: var(--muted); font-size: 0.75rem; }

.feedback-row { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.feedback-row > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.feedback-row strong, .feedback-row span { display: block; }
.feedback-row strong { color: var(--ink); font-size: 0.8rem; line-height: 1.4; }
.feedback-row span { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }

.empty-state { padding: 28px 15px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }

dialog {
  width: min(720px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(12, 39, 33, 0.24);
}
dialog::backdrop { background: rgba(10, 30, 26, 0.42); backdrop-filter: blur(4px); }
dialog form { padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-heading h2 { margin-bottom: 5px; color: var(--ink-strong); }
.dialog-heading span { color: var(--muted); font-size: 0.85rem; }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); }
.icon-button svg { width: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid label { display: grid; gap: 7px; }
.field-grid .full-width { grid-column: 1 / -1; }
.consent-check { grid-template-columns: auto minmax(0, 1fr) !important; align-items: start; }
.consent-check input { width: 20px; min-height: 20px; margin-top: 1px; }
.consent-check span { font-size: 0.86rem !important; line-height: 1.4; }
.privacy-note { display: flex; gap: 9px; margin: 18px 0 0; padding: 12px; border-radius: 13px; background: var(--green-soft); color: var(--green); font-size: 0.79rem; line-height: 1.45; }
.privacy-note svg { width: 17px; flex: 0 0 auto; }
dialog footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

@media (max-width: 980px) {
  .worker-gate { grid-template-columns: 1fr; min-height: auto; padding: 70px 0; }
  .gate-card { max-width: 560px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .worker-shell { width: min(100% - 28px, 1400px); padding-top: 14px; }
  .topbar nav a { display: none; }
  .brand small { font-size: 0.72rem; }
  .worker-gate { padding: 50px 0; }
  .gate-copy h1 { font-size: clamp(2.8rem, 14vw, 4.6rem); }
  .gate-card { padding: 25px; }
  .workspace-hero { display: grid; align-items: start; padding-top: 8px; }
  .hero-actions { width: 100%; }
  .hero-actions > * { flex: 1; padding-inline: 12px; }
  .master-strip { grid-template-columns: auto minmax(0, 1fr); }
  .master-strip > a { grid-column: 2; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 108px; padding: 16px; }
  .metric-card strong { font-size: 1.9rem; }
  .work-panel { padding: 16px; }
  .panel-heading { display: grid; }
  .segmented-filter { width: fit-content; }
  .assignment-card { grid-template-columns: 1fr auto; }
  .number-token { min-width: 0; }
  .assignment-detail { grid-column: 1 / -1; grid-row: 2; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .full-width { grid-column: auto; }
  dialog footer { display: grid; grid-template-columns: 1fr; }
  dialog footer button { width: 100%; }
}
