:root {
  color-scheme: light;
  --ink: #25211f;
  --muted: #6f6863;
  --line: #ded8d2;
  --surface: #ffffff;
  --canvas: #f7f4f0;
  --accent: #315bea;
  --accent-hover: #2548c2;
  --accent-ink: #ffffff;
  --shadow: 0 0.5rem 1.5rem rgb(52 42 34 / 7%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
}

.role-barista,
.role-master {
  --accent: #8062db;
  --accent-hover: #6848c3;
  background:
    radial-gradient(circle at 95% 5%, rgb(218 202 255 / 45%), transparent 28rem),
    #faf6fb;
}

a,
button,
input,
select {
  outline-offset: 0.1875rem;
}

:focus-visible {
  outline: 0;
  filter:
    drop-shadow(0 0 0.2rem rgb(255 246 218 / 90%))
    drop-shadow(0 0 0.55rem rgb(209 161 67 / 85%));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(0.75rem);
}

.site-header[hidden],
.messages:empty {
  display: none;
}

.employee-profile {
  display: none;
}

.admin-context {
  display: grid;
  gap: 0.1rem;
}

.admin-context span {
  color: var(--muted);
  font-size: 0.7rem;
}

.avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #ae8df5, #7554dc);
  font-weight: 850;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions a,
.header-actions .link-button {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.header-actions a:hover,
.header-actions .link-button:hover {
  color: var(--ink);
}

.page {
  width: min(72rem, 100% - 2rem);
  margin: 2rem auto;
}

h1,
h2 {
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
}

.auth-panel {
  width: min(24rem, 100%);
  margin: 8vh auto 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

label {
  font-size: 0.875rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #9da39d;
  border-radius: 0.625rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.button {
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: 0.625rem;
  color: var(--accent-ink);
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.error {
  padding: 0.75rem;
  border-left: 0.25rem solid #a53b36;
  background: #fff0ef;
}

.messages {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-left: 0.25rem solid #779f3b;
  background: #eff8e5;
}

.messages p {
  margin: 0;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
}

.stats-grid {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.stat-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 1.75rem;
}

.stat-card small {
  color: var(--muted);
}

.employee-hero {
  position: relative;
  display: grid;
  gap: 1.5rem;
  min-height: 14rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  overflow: hidden;
  border: 1px solid #d9cafa;
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 85% 20%, rgb(255 255 255 / 75%) 0 8%, transparent 9%),
    linear-gradient(120deg, #f1e9ff, #d9c8ff 55%, #f7dff2);
  box-shadow: 0 1rem 2.5rem rgb(93 67 154 / 16%);
}

.employee-hero h1 {
  max-width: 38rem;
  margin: 0 0 0.75rem;
  color: #35235e;
}

.employee-hero p:not(.eyebrow) {
  max-width: 34rem;
  margin-bottom: 1.25rem;
  color: #66577e;
}

.achievement-grid {
  display: grid;
  gap: 0.75rem;
}

.achievement {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 6rem;
  padding: 0.8rem;
  border: 1px dashed #d6cedd;
  border-radius: 1rem;
  color: var(--muted);
  background: #f7f4f8;
  filter: grayscale(0.75);
}

.achievement h3 {
  margin: 0;
  font-size: 0.95rem;
}

.achievement p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
}

.achievement > span {
  grid-column: 2;
  width: fit-content;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  color: #6542bb;
  background: #e7dcff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-panel {
  width: min(32rem, 100%);
}

.help-text {
  margin: -0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #faf8f5;
}

th {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.empty {
  padding: 1rem;
  border: 1px dashed #9da39d;
  color: var(--muted);
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  margin: 0;
}

.week-nav {
  display: flex;
  gap: 0;
}

.week-nav a {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}

.week-nav a:first-child {
  border-radius: 0.625rem 0 0 0.625rem;
}

.week-nav a:last-child {
  margin-left: -1px;
  border-radius: 0 0.625rem 0.625rem 0;
}

.notice {
  padding: 0.75rem;
  border-left: 0.25rem solid #779f3b;
  background: #eff8e5;
}

.schedule-scroll {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.schedule-actions .status {
  margin-right: auto;
}

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}

.legend-dot--time {
  background: #b9cdf8;
}

.legend-dot--off {
  background: #f4bdc2;
}

.legend-dot--none {
  background: #d8d8d8;
}

.schedule-table {
  min-width: 72rem;
  table-layout: fixed;
}

.timesheet-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--line);
}

.timesheet-table {
  min-width: 70rem;
}

.timesheet-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef1ed;
}

.schedule-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 13rem;
  min-width: 13rem;
  background: var(--surface);
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 4.25rem;
  border-right: 1px solid #d9d2e4;
  color: #4d3d6e;
  background: #eee8fa;
  text-align: center;
}

.schedule-table thead th:first-child {
  z-index: 12;
  text-align: left;
}

.schedule-table thead th span,
.schedule-table thead th strong {
  display: block;
}

.schedule-table thead th span {
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
}

.schedule-table tbody th {
  vertical-align: top;
  border-right: 1px solid var(--line);
}

.schedule-table tbody th strong,
.schedule-table tbody th span {
  display: block;
}

.schedule-table tbody th strong {
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 0.85rem;
  text-transform: none;
}

.schedule-table tbody th span {
  font-size: 0.68rem;
  text-transform: none;
}

.schedule-table td {
  width: 8.5rem;
  min-width: 8.5rem;
  height: 10rem;
  padding: 0;
  border-right: 1px solid var(--line);
  vertical-align: top;
}

.preference-block,
.assigned-shift {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem;
}

.preference-block {
  min-height: 3.75rem;
  border-bottom: 1px solid rgb(86 72 110 / 10%);
}

.preference-block span,
.assigned-shift > span:first-child {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preference-block strong,
.assigned-shift strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.schedule-cell--time .preference-block {
  background: #eaf1ff;
}

.schedule-cell--off .preference-block {
  background: #fff0f1;
}

.schedule-cell--none .preference-block {
  background: #f5f4f3;
}

.assigned-shift {
  background: #f4faee;
}

.assigned-shift .status {
  margin-top: 0.25rem;
}

.shift-empty {
  margin: 0;
  padding: 0.65rem;
  color: #99918b;
  font-size: 0.72rem;
}

.cell-editor {
  border-top: 1px solid var(--line);
}

.cell-editor summary {
  padding: 0.55rem 0.65rem;
  color: #315bea;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.cell-editor summary::-webkit-details-marker {
  display: none;
}

.cell-editor[open] summary {
  border-bottom: 1px solid var(--line);
}

.cell-form {
  display: grid;
  gap: 0.5rem;
  padding: 0.65rem;
}

.cell-form label {
  font-size: 0.65rem;
}

.cell-form input[type="time"] {
  min-height: 2rem;
  padding: 0.25rem;
  font-size: 0.72rem;
}

.cell-form .button {
  min-height: 2rem;
  padding: 0.35rem;
  font-size: 0.72rem;
}

.compact-times {
  display: grid;
  gap: 0.35rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f5f3f1;
  font-size: 0.75rem;
  font-weight: 750;
}

.status--pending {
  border-color: #edcf95;
  color: #76500b;
  background: #fff8e8;
}

.status--rejected {
  border-color: #edb9b5;
  color: #87342e;
  background: #fff1f0;
}

.status--editing {
  border-color: #b9c7f5;
  color: #2548c2;
  background: #eef2ff;
}

.status--confirmed,
.status--accepted,
.status--agreed {
  border-color: #b7dbc7;
  color: #195d39;
  background: #edf8f1;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.table-toolbar h2 {
  margin: 0;
}

.search-field {
  width: min(18rem, 100%);
}

.search-field input {
  min-height: 2.5rem;
  background: var(--surface);
}

.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;
}

.request-list {
  border-top: 1px solid var(--ink);
}

.role-barista .request-list,
.role-master .request-list {
  display: grid;
  gap: 0.75rem;
  border: 0;
}

.role-barista .request-row,
.role-master .request-row {
  padding: 1rem;
  border: 1px solid #d5c8b9;
  border-radius: 0.35rem;
  background: linear-gradient(145deg, #f8f3ea, #eee6da);
  box-shadow: var(--shadow);
}


.role-barista .panel,
.role-master .panel {
  border-color: #d5c8b9;
}

.request-row {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.request-row h2 {
  margin: 0;
  font-size: 1rem;
}

.request-row p {
  margin: 0.5rem 0 0;
}

.request-row .status {
  display: inline-block;
  margin-left: 0.5rem;
}

.request-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  margin: 0.75rem 0;
}

.request-comparison > div {
  min-width: 0;
  padding: 0.7rem 0.55rem;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.5);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.55);
}

.request-comparison > div > span {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.request-comparison strong {
  display: block;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.request-comparison__time {
  font-size: 0.8rem !important;
  white-space: nowrap;
}

.request-comparison__arrow {
  color: var(--terracotta);
  font-size: 1.25rem;
  font-weight: 700;
}

.request-actions,
.counter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.counter-form {
  align-items: end;
  width: 100%;
}

.counter-form input {
  width: 8rem;
}

@media (min-width: 48rem) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .employee-hero {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-row {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, auto);
    align-items: center;
  }
}

@media (min-width: 72rem) {
  .achievement-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tactile cream and terracotta theme from the approved UI reference. */
:root {
  --ink: #2d261f;
  --muted: #74695e;
  --line: #d4c7b8;
  --surface: #f4efe5;
  --canvas: #eae3d8;
  --accent: #c9754d;
  --accent-hover: #b9613a;
  --accent-ink: #fffaf3;
  --shadow:
    0.45rem 0.55rem 1rem rgb(80 59 42 / 14%),
    -0.35rem -0.35rem 0.8rem rgb(255 255 255 / 72%);
  background: var(--canvas);
}

body,
.role-barista,
.role-master {
  background:
    radial-gradient(circle at 15% 5%, rgb(255 255 255 / 60%), transparent 24rem),
    linear-gradient(135deg, #eee8de, #e6ddd0);
}

.site-header {
  border-color: #d0c1b1;
  background: rgb(244 239 229 / 94%);
  box-shadow: 0 0.25rem 0.8rem rgb(81 59 41 / 10%);
}

.auth-panel,
.panel,
.stat-card,
.schedule-scroll,
.timesheet-scroll {
  border-color: #d5c8b9;
  border-radius: 0.35rem;
  background: linear-gradient(145deg, #f8f3ea, #eee6da);
  box-shadow: var(--shadow);
}

input,
select {
  border: 1px solid #cbbcac;
  border-radius: 0.2rem;
  background: #eee7dc;
  box-shadow:
    inset 0.2rem 0.25rem 0.45rem rgb(80 58 41 / 14%),
    inset -0.15rem -0.15rem 0.35rem rgb(255 255 255 / 75%);
}

input:focus,
select:focus {
  border-color: #bd6841;
  background: #f7f0e6;
}

.button,
.secondary-button,
.week-nav a {
  border: 1px solid #b9613a;
  border-radius: 0.2rem;
  box-shadow:
    0.22rem 0.28rem 0.45rem rgb(87 54 33 / 22%),
    inset 1px 1px 1px rgb(255 255 255 / 30%);
}

.button {
  color: var(--accent-ink);
  background: linear-gradient(#d98961, #bd6841);
}

.button:hover {
  background: linear-gradient(#df9168, #b9613a);
}

.secondary-button,
.week-nav a {
  color: #70442e;
  background: linear-gradient(145deg, #faf5ed, #e9dfd2);
}

.button:active,
.secondary-button:active,
.week-nav a:active {
  transform: translateY(2px);
  box-shadow:
    inset 0.18rem 0.2rem 0.35rem rgb(85 53 34 / 22%),
    inset -1px -1px 2px rgb(255 255 255 / 55%);
}

.eyebrow,
th {
  color: #74513e;
}

.messages,
.notice {
  border-color: #bf704c;
  background: #f5e7da;
  box-shadow: 0.2rem 0.25rem 0.5rem rgb(83 57 38 / 10%);
}

.status {
  border-color: #ccb9a7;
  border-radius: 0.2rem;
  color: #6f5747;
  background: #eee4d7;
  box-shadow:
    0.12rem 0.16rem 0.25rem rgb(80 58 41 / 12%),
    inset 1px 1px 1px rgb(255 255 255 / 50%);
}

.status--pending {
  border-color: #d5a35b;
  color: #76500b;
  background: #f6e7c8;
}

.status--rejected {
  border-color: #c9857c;
  color: #87342e;
  background: #f4deda;
}

.status--confirmed,
.status--accepted,
.status--agreed {
  border-color: #9eb49a;
  color: #3f6343;
  background: #e1ebdc;
}

.employee-hero {
  border-color: #d2b49f;
  border-radius: 0.5rem;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 28%), transparent 45%),
    #eee1d2;
  box-shadow:
    0.7rem 0.8rem 1.5rem rgb(80 55 37 / 16%),
    -0.5rem -0.45rem 1rem rgb(255 255 255 / 72%);
}

.employee-hero::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 3rem;
  height: 3rem;
  border-left: 1px solid #d4c3b3;
  border-bottom: 1px solid #d4c3b3;
  background: linear-gradient(225deg, #e1d4c5 50%, transparent 51%);
  content: "";
}

.employee-hero h1 {
  color: #3b2a21;
}

.employee-hero p:not(.eyebrow) {
  color: #756255;
}


.avatar {
  border-color: #f7eee3;
  background: linear-gradient(145deg, #d78b65, #aa5835);
  box-shadow:
    0.45rem 0.55rem 0.9rem rgb(80 48 30 / 25%),
    -0.25rem -0.25rem 0.6rem rgb(255 255 255 / 55%);
}

.stat-card:nth-child(2n) {
  border-color: #d8b49c;
  background: linear-gradient(145deg, #f7e9dd, #ead5c5);
}


.achievement > span {
  color: #7e4327;
  background: #ead1bf;
}

.achievement {
  border-radius: 0.3rem;
  background: linear-gradient(145deg, #f4eee5, #e9dfd3);
}

.week-nav a:first-child,
.week-nav a:last-child {
  border-radius: 0.2rem;
}

.schedule-table thead th,
.timesheet-table th {
  color: #654634;
  background: linear-gradient(#eee3d6, #e4d6c7);
  box-shadow: inset 0 -2px 0 #c9774f;
}

.schedule-cell--time .preference-block {
  background: #f2e4d7;
}

.schedule-cell--off .preference-block {
  background: #f2dcda;
}

.schedule-cell--none .preference-block {
  background: #ebe5dc;
}

.assigned-shift {
  background: #e7eadc;
}

.cell-editor summary {
  color: #a95531;
}

.legend-dot--time {
  background: #d28a64;
}

.legend-dot--off {
  background: #ca8781;
}

.legend-dot--none {
  background: #b8afa4;
}

@media (min-width: 56rem) {
  .role-barista .site-header,
  .role-master .site-header {
    border-color: #cda184;
    border-radius: 0.5rem;
    background: linear-gradient(145deg, #f1e6da, #ddcfc0);
    box-shadow:
      0.7rem 0.8rem 1.5rem rgb(75 52 36 / 18%),
      -0.4rem -0.4rem 0.9rem rgb(255 255 255 / 65%);
  }

  
  .role-barista .employee-profile,
  .role-master .employee-profile {
    color: #3f2d22;
  }

  .role-barista .header-actions a,
  .role-barista .header-actions .link-button,
  .role-master .header-actions a,
  .role-master .header-actions .link-button {
    border-radius: 0.2rem;
    color: #634b3b;
  }

  .role-barista .header-actions a:hover,
  .role-barista .header-actions .link-button:hover,
  .role-master .header-actions a:hover,
  .role-master .header-actions .link-button:hover {
    color: #7e4327;
    background: #ead8c9;
  }

  .role-barista .header-actions a.active,
  .role-master .header-actions a.active {
    color: #7c3e23;
    background: #efe3d6;
    box-shadow:
      inset 0.16rem 0.2rem 0.35rem rgb(80 57 40 / 13%),
      inset -0.12rem -0.12rem 0.3rem rgb(255 255 255 / 65%);
  }
}

@media (max-width: 47.99rem) {
  .site-header {
    display: block;
    padding-bottom: 0;
  }

  .header-actions {
    width: calc(100% + 2rem);
    margin: 0.75rem -1rem 0;
    padding: 0 1rem 0.75rem;
    overflow-x: auto;
    white-space: nowrap;
  }

  .page {
    width: min(100% - 1rem, 72rem);
    margin: 1.25rem auto;
  }

  .schedule-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-actions .status {
    margin-right: 0;
  }

  .search-field {
    width: 100%;
  }
}

@media (min-width: 56rem) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }

  .role-barista .site-header,
  .role-master .site-header {
    position: fixed;
    top: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: 14rem;
    min-height: 0;
    padding: 1.25rem;
    border: 1px solid #cda184;
    border-radius: 0.5rem;
    background: linear-gradient(145deg, #f1e6da, #ddcfc0);
    box-shadow:
      0.7rem 0.8rem 1.5rem rgb(75 52 36 / 18%),
      -0.4rem -0.4rem 0.9rem rgb(255 255 255 / 65%);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .role-barista .employee-profile,
  .role-master .employee-profile {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    margin: 1.75rem 0;
    color: #3f2d22;
  }

  .employee-profile .avatar {
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 0.5rem;
    border: 0.35rem solid rgb(255 255 255 / 55%);
    border-radius: 50%;
    font-size: 2rem;
  }

  .employee-profile span {
    color: #765e4e;
    font-size: 0.75rem;
  }

  .role-barista .header-actions,
  .role-master .header-actions {
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .role-barista .header-actions a,
  .role-barista .header-actions .link-button,
  .role-master .header-actions a,
  .role-master .header-actions .link-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.2rem;
    color: #634b3b;
    text-align: left;
  }

  .role-barista .header-actions a::before,
  .role-master .header-actions a::before {
    width: 1.1rem;
    content: attr(data-icon);
    font-size: 1rem;
    text-align: center;
  }

  .role-barista .header-actions a:hover,
  .role-barista .header-actions .link-button:hover,
  .role-master .header-actions a:hover,
  .role-master .header-actions .link-button:hover {
    color: #7e4327;
    background: #ead8c9;
  }

  .role-barista .header-actions a.active,
  .role-master .header-actions a.active {
    color: #7c3e23;
    background: #efe3d6;
    box-shadow:
      inset 0.16rem 0.2rem 0.35rem rgb(80 57 40 / 13%),
      inset -0.12rem -0.12rem 0.3rem rgb(255 255 255 / 65%);
  }

  .role-barista .header-actions form,
  .role-master .header-actions form {
    margin-top: auto;
  }

  .role-barista .page,
  .role-master .page {
    width: min(82rem, calc(100% - 18rem));
    margin: 2rem 2rem 2rem 16rem;
  }
}

/* Olive, terracotta and woven-rug interface system. */
:root {
  --ink: #29271f;
  --muted: #675f50;
  --line: #cfc3ad;
  --surface: #f3ecdc;
  --canvas: #3f4530;
  --accent: #a84f32;
  --accent-hover: #8e3e28;
  --accent-ink: #fff8e9;
  --olive: #343b27;
  --olive-deep: #252c1d;
  --moss: #718051;
  --mustard: #d1a143;
  --terracotta: #ad5637;
  --paper: #eee6d5;
  --shadow: 0 0.85rem 2rem rgb(35 30 20 / 22%);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--canvas);
}

body,
.role-barista,
.role-master {
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgb(39 43 29 / 32%), rgb(39 43 29 / 32%)),
    url("/static/images/rug-pattern.webp");
  background-size: auto, 46rem;
}

body,
button,
input,
select,
.eyebrow,
th,
.stat-card span,
.schedule-table tbody th strong {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2 {
  letter-spacing: -0.015em;
}

.site-header {
  border: 1px solid rgb(242 232 210 / 18%);
  color: #fff8e9;
  background: var(--olive);
  box-shadow: 0 0.75rem 1.75rem rgb(31 28 20 / 24%);
  backdrop-filter: none;
}


.header-actions a,
.header-actions .link-button {
  color: #f6eedc;
}

.header-actions a:hover,
.header-actions .link-button:hover {
  color: #fff;
}

.page {
  padding: clamp(1rem, 2vw, 1.75rem);
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 10% 0, rgb(255 255 255 / 52%), transparent 25rem),
    var(--paper);
  box-shadow: 0 1.4rem 3.5rem rgb(24 25 17 / 38%);
}

.auth-panel,
.panel,
.stat-card,
.schedule-scroll,
.timesheet-scroll {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #f5eddd;
  box-shadow: 0 0.55rem 1.25rem rgb(62 49 31 / 11%);
}

.auth-panel {
  margin: 8vh auto;
}

.panel,
.stat-card {
  transition:
    border-color 180ms ease-out,
    box-shadow 180ms ease-out,
    transform 180ms ease-out;
}

.panel:hover,
.stat-card:hover {
  border-color: #b9aa90;
  box-shadow: 0 0.75rem 1.6rem rgb(62 49 31 / 15%);
}

input,
select {
  border: 1px solid #bcb096;
  border-radius: 0.55rem;
  color: var(--ink);
  background: #e9dfcd;
  box-shadow: inset 0 0.12rem 0.28rem rgb(58 45 28 / 12%);
}

input:focus,
select:focus {
  border-color: var(--terracotta);
  background: #f8f1e3;
  box-shadow: 0 0 0 0.2rem rgb(168 79 50 / 14%);
}

.button,
.secondary-button,
.week-nav a {
  border-radius: 0.55rem;
  box-shadow: 0 0.3rem 0.65rem rgb(65 42 26 / 18%);
}

.button {
  border: 1px solid #8e3e28;
  color: #fff8e9;
  background: var(--terracotta);
}

.button:hover {
  background: var(--accent-hover);
}

.secondary-button,
.week-nav a {
  border: 1px solid #a99c83;
  color: #333621;
  background: #e7dcc7;
}

.secondary-button:hover,
.week-nav a:hover {
  border-color: var(--moss);
  background: #f2e9d8;
}

.button:active,
.secondary-button:active,
.week-nav a:active {
  transform: translateY(1px);
  box-shadow: inset 0 0.15rem 0.3rem rgb(58 42 27 / 20%);
}

.eyebrow,
th {
  color: #695843;
  letter-spacing: 0.045em;
  text-transform: none;
}

.messages,
.notice,
.error {
  border: 1px solid #aa765d;
  border-radius: 0.65rem;
  background: #ead7c5;
  box-shadow: none;
}

.status {
  border: 1px solid #b9aa90;
  border-radius: 999px;
  color: #5b5142;
  background: #e4d8c4;
  box-shadow: none;
}

.status--pending {
  border-color: #b78731;
  color: #60430d;
  background: #ead49f;
}

.status--rejected {
  border-color: #a66858;
  color: #6f2e23;
  background: #e8c8bd;
}

.status--confirmed,
.status--accepted,
.status--agreed {
  border-color: #7e8b5d;
  color: #354126;
  background: #d4ddbd;
}

.employee-hero {
  border: 1px solid #b8aa8e;
  border-radius: 1rem;
  background: url("/static/images/rug-pattern.webp") center / cover;
  box-shadow: 0 0.85rem 1.9rem rgb(67 49 30 / 17%);
}

.employee-hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, rgb(241 232 215 / 62%), rgb(241 232 215 / 38%));
  content: "";
  pointer-events: none;
}

.employee-hero::after {
  display: none;
}

.employee-hero__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-hero__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5rem;
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.68;
  transform: translate(-50%, -50%);
}

.employee-hero__content,
.employee-hero .rank-card {
  position: relative;
  z-index: 2;
}

.employee-hero h1 {
  color: #302d22;
}

.employee-hero p:not(.eyebrow) {
  color: #665c4a;
}


.avatar {
  border-color: #f4ead8;
  color: #fff8e9;
  background: var(--terracotta);
  box-shadow: 0 0.55rem 1.1rem rgb(39 31 21 / 30%);
}

.stat-card {
  min-height: 8rem;
  border-radius: 0.9rem;
}

.page-heading a {
  color: #7f3c28;
  font-weight: 700;
}

.achievement {
  border-radius: 0.75rem;
  background: #e8dfcf;
}

.achievement > span {
  color: #fff8e9;
  background: var(--olive);
}

table {
  background: #f5eddd;
}

th,
td {
  border-color: #d5c9b4;
}

tbody tr:hover {
  background: #ebe1cf;
}

.schedule-table thead th,
.timesheet-table th {
  color: #fff8e9;
  background: var(--olive);
  box-shadow: none;
}

.schedule-table th:first-child {
  background: #f5eddd;
}

.schedule-table thead th:first-child {
  color: #fff8e9;
  background: var(--olive-deep);
}

.schedule-cell--time .preference-block {
  background: #ead8c8;
}

.schedule-cell--off .preference-block {
  background: #e4cfaa;
}

.schedule-cell--none .preference-block {
  background: #e7dfd1;
}

.assigned-shift {
  background: #dce2ca;
}

.cell-editor summary {
  color: #8e3e28;
}

.legend-dot--time {
  background: var(--terracotta);
}

.legend-dot--off {
  background: var(--mustard);
}

.legend-dot--none {
  background: #aaa18f;
}

@media (min-width: 56rem) {
  .role-manager .site-header {
    width: min(82rem, calc(100% - 2rem));
    margin: 1rem auto 0;
    border-radius: 0.9rem;
  }

  .role-manager .page {
    width: min(82rem, calc(100% - 2rem));
    margin: 0.75rem auto 1rem;
  }

  .role-barista .site-header,
  .role-master .site-header {
    top: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: 14.5rem;
    padding: 1.25rem;
    border-color: rgb(244 235 216 / 15%);
    border-radius: 1rem;
    color: #fff8e9;
    background: var(--olive);
    box-shadow: 0 1.25rem 2.75rem rgb(27 27 18 / 40%);
  }

  
  .role-barista .employee-profile,
  .role-master .employee-profile {
    color: #fff8e9;
  }

  .role-barista .employee-profile span,
  .role-master .employee-profile span {
    color: #cfcdb7;
  }

  .role-barista .header-actions a,
  .role-barista .header-actions .link-button,
  .role-master .header-actions a,
  .role-master .header-actions .link-button {
    border-radius: 0.55rem;
    color: #dad9c6;
  }

  .role-barista .header-actions a:hover,
  .role-barista .header-actions .link-button:hover,
  .role-master .header-actions a:hover,
  .role-master .header-actions .link-button:hover {
    color: #fff8e9;
    background: #444c32;
  }

  .role-barista .header-actions a.active,
  .role-master .header-actions a.active {
    color: #fff8e9;
    background: var(--terracotta);
    box-shadow: 0 0.35rem 0.7rem rgb(20 22 15 / 25%);
  }

  .role-barista .page,
  .role-master .page {
    width: min(82rem, calc(100% - 17.5rem));
    min-height: calc(100dvh - 2rem);
    margin: 1rem 1rem 1rem 16.5rem;
  }
}

@media (max-width: 55.99rem) {
  .site-header {
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .page {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
    padding: 0.85rem;
    border-radius: 0.9rem;
  }

  .employee-hero {
    background-size: auto, cover;
  }
}

@media (max-width: 35rem) {
  .employee-hero {
    background-image:
      linear-gradient(rgb(241 232 215 / 90%), rgb(241 232 215 / 90%)),
      url("/static/images/rug-pattern.webp");
  }

  .stat-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@font-face {
  font-family: "Caveat";
  src: url("/static/fonts/caveat-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("/static/fonts/jost-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Dela Gothic One";
  src: url("/static/fonts/dela-gothic-one-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}

@font-face {
  font-family: "Dela Gothic One";
  src: url("/static/fonts/dela-gothic-one-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02bb-02bc, U+02c6, U+02da,
    U+02dc, U+0304, U+0308, U+0329, U+2000-206f, U+20ac, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+feff, U+fffd;
}

@font-face {
  font-family: "Jost";
  src: url("/static/fonts/jost-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

.role-barista .employee-profile,
.role-master .employee-profile {
  margin-top: 0.5rem;
}

.role-barista .employee-profile .avatar,
.role-master .employee-profile .avatar {
  border-color: rgb(255 255 255 / 85%);
  box-shadow:
    0 0 0 0.22rem rgb(255 255 255 / 20%),
    0 0 1.6rem rgb(255 255 255 / 55%);
}

.role-barista .employee-profile strong,
.role-master .employee-profile strong {
  font-family: "Caveat", cursive;
  font-size: 2rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}

.role-barista .header-actions a,
.role-barista .header-actions .link-button,
.role-master .header-actions a,
.role-master .header-actions .link-button {
  font-family: "Jost", sans-serif;
  font-style: normal;
  font-weight: 500;
}

.logout-button {
  justify-content: center;
}

.logout-button svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.employee-hero__content {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
}

.employee-hero__content h1 {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: clamp(3.25rem, 6vw, 5rem);
  font-style: normal;
  font-weight: 600;
  line-height: 0.95;
}

.rank-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-width: 12rem;
  padding: 0.85rem 1rem;
  border: 1px solid #b8aa8e;
  border-radius: 1rem;
  background: #f3ead8;
  box-shadow: 0 0.65rem 1.4rem rgb(50 39 25 / 22%);
  text-align: center;
}

.rank-card > strong {
  color: #29301f;
  font-size: 1.1rem;
}

.rank-card > small {
  max-width: 13rem;
  color: #554c3d;
  font-weight: 600;
  white-space: nowrap;
}

.rank-ring {
  display: grid;
  width: 7.5rem;
  height: 7.5rem;
  padding: 0.55rem;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fffaf0 0 8%, transparent 9%),
    linear-gradient(145deg, #fffdf7, #d8ccb5 48%, var(--terracotta));
  box-shadow: 0 0.65rem 1.4rem rgb(60 43 27 / 18%);
}

.rank-ring > div {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  align-content: center;
  border: 0.35rem solid rgb(255 255 255 / 60%);
  border-radius: 50%;
  background: #f3ead8;
}

.rank-ring span {
  font-size: 2.25rem;
  line-height: 1;
}

.rank-ring small {
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-style: normal;
}

.stat-card span {
  color: inherit;
  font-family: "Jost", sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.role-barista .stat-card strong,
.role-master .stat-card strong,
.role-barista .stat-card small,
.role-master .stat-card small,
.rank-card > small,
.rank-ring small {
  font-family: "Jost", sans-serif;
  font-style: normal;
}

.stat-card progress {
  width: 100%;
  height: 0.55rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 28%);
}

.stat-card progress::-webkit-progress-bar {
  border-radius: inherit;
  background: rgb(255 255 255 / 28%);
}

.stat-card progress::-webkit-progress-value {
  border-radius: inherit;
  background: #fff5df;
}

.stat-card progress::-moz-progress-bar {
  border-radius: inherit;
  background: #fff5df;
}

.personal-schedule-table td {
  height: auto;
}

.personal-schedule-table .slot-card {
  min-height: 7rem;
}

.personal-schedule-table .preference-block,
.personal-schedule-table .assigned-shift {
  min-height: 7rem;
  align-content: center;
}

.schedule-table td {
  width: 10.5rem;
  min-width: 10.5rem;
  padding: 0.3rem;
  background: #e4dac7;
}

.slot-card {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid #c9bda7;
  border-radius: 0.75rem;
  background: #f6eedf;
  box-shadow: 0 0.3rem 0.7rem rgb(55 43 27 / 10%);
}

.slot-card .preference-block,
.slot-card .assigned-shift {
  border-radius: 0;
}

.slot-card .cell-editor {
  border-top-color: #d8cdb9;
}

.slot-card .cell-editor summary {
  position: relative;
  min-height: 2.75rem;
  padding: 0.75rem 3.8rem 0.75rem 0.75rem;
  color: #713921;
  font-family: "Jost", sans-serif;
  font-style: normal;
  font-weight: 500;
}

.slot-card .cell-editor summary::after {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  width: 2.5rem;
  height: 1.45rem;
  border: 1px solid #bdb29f;
  border-radius: 999px;
  background: #d9cfbd;
  box-shadow: inset 0 0.1rem 0.25rem rgb(58 45 29 / 14%);
  content: "";
  transform: translateY(-50%);
  transition: background 180ms ease-out;
}

.slot-card .cell-editor summary::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 1.82rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff9eb;
  box-shadow: 0 0.12rem 0.3rem rgb(54 41 25 / 24%);
  content: "";
  transform: translateY(-50%);
  transition: transform 180ms ease-out;
}

.slot-card .cell-editor[open] summary::after {
  border-color: #84442d;
  background: var(--terracotta);
}

.slot-card .cell-editor[open] summary::before {
  transform: translate(1rem, -50%);
}

.slot-card .cell-form {
  background: #efe5d3;
  animation: slot-reveal 180ms ease-out;
}

.slot-card .compact-times {
  grid-template-columns: 1fr;
}

.slot-card .compact-times > div {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.3rem;
}

.slot-card .compact-times label {
  margin: 0;
}

.slot-card .compact-times input {
  min-width: 0;
  width: 100%;
  font-size: 0.75rem;
}

.slot-card .correction-editor {
  border-top: 0;
}

.slot-card .correction-editor summary {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  width: 1.8rem;
  min-height: 1.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid #b9aa91;
  border-radius: 0.45rem;
  color: #6f3824;
  background: #f4ead8;
  box-shadow: 0 0.2rem 0.45rem rgb(57 42 26 / 14%);
}

.slot-card .correction-editor summary::before,
.slot-card .correction-editor summary::after {
  display: none;
}

.slot-card .correction-editor summary svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.schedule-table--schedule:not(.personal-schedule-table) .preference-block {
  padding-right: 3.25rem;
}

.schedule-table--schedule:not(.personal-schedule-table) .preference-block strong {
  white-space: nowrap;
}

.slot-card .correction-editor[open] summary {
  color: #fff8e9;
  background: var(--terracotta);
}

.slot-card .correction-editor .cell-form {
  border-top: 1px solid #d8cdb9;
}

.correction-status-icon {
  position: absolute;
  z-index: 2;
  top: auto;
  right: auto;
  bottom: 0.475rem;
  left: 0.475rem;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid #a7773a;
  border-radius: 50%;
  font-family: "Jost", sans-serif;
  font-style: normal;
  font-weight: 600;
}

.correction-status-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.correction-status-icon--pending {
  color: #673b1c;
  background: #f6d798;
}

.correction-status-icon--accepted {
  color: #fff;
  background: #718051;
}

.correction-status-icon--rejected {
  color: #fff;
  background: #a34337;
}

.employee-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.employee-actions > form {
  margin: 0;
}

.employee-editor {
  border: 0;
}

.employee-editor summary,
.icon-button {
  display: grid;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  place-items: center;
  border: 1px solid #b9aa91;
  border-radius: 0.5rem;
  color: #6f3824;
  background: #f4ead8;
  cursor: pointer;
}

.employee-editor[open] summary {
  color: #fff8e9;
  background: var(--terracotta);
}

.employee-editor summary svg,
.icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.employee-editor .cell-form {
  min-width: 13rem;
}

.icon-button--danger {
  color: #913f32;
  background: #f2ddd5;
}

.icon-button--danger:hover {
  color: #fff8e9;
  background: #a34337;
}

.auth-page .page {
  width: min(24rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: max(1rem, 10vh) 0 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-page .auth-panel {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-color: rgb(255 255 255 / 52%);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 38%), rgb(236 224 201 / 18%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 68%),
    0 1.25rem 3rem rgb(24 25 17 / 34%);
  -webkit-backdrop-filter: blur(1.25rem) saturate(135%);
  backdrop-filter: blur(1.25rem) saturate(135%);
}

.auth-page .auth-panel::before {
  position: absolute;
  inset: 0 auto auto 8%;
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 90%), transparent);
  content: "";
  pointer-events: none;
}

.auth-page .auth-panel h1 {
  text-align: center;
}

.auth-page .auth-panel input {
  border-color: rgb(77 70 51 / 42%);
  background: rgb(250 245 234 / 62%);
  -webkit-backdrop-filter: blur(0.5rem);
  backdrop-filter: blur(0.5rem);
}

@keyframes slot-reveal {
  from {
    opacity: 0;
    transform: translateY(-0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root,
body,
button,
input,
select,
.eyebrow,
th,
.stat-card span,
.schedule-table tbody th strong {
  font-family: "Jost", sans-serif;
  font-style: normal;
}

@media (max-width: 55.99rem) {
  .role-barista .site-header,
  .role-master .site-header {
    padding-top: 0;
  }

  .role-barista .header-actions,
  .role-master .header-actions {
    margin-top: 0;
  }
}

@media (max-width: 35rem) {
  .rank-card {
    width: 100%;
  }
}

/* Final responsive pass: keep the same interface, make it usable on touch screens. */
h1,
h2,
h3 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#app,
.dashboard-grid,
.dashboard-grid > *,
.table-toolbar,
.table-scroll,
.schedule-scroll,
.timesheet-scroll {
  min-width: 0;
  max-width: 100%;
}

.rank-ring {
  position: relative;
  padding: 0;
  background: #e2d7c1;
}

.rank-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rank-ring circle {
  fill: none;
  stroke-width: 9;
}

.rank-ring__track {
  stroke: #c8bda7;
}

.rank-ring__value {
  stroke: var(--terracotta);
  stroke-linecap: round;
}

.rank-ring__value--empty {
  stroke: transparent;
}

.rank-ring > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #29301f;
}

.rank-card > div:last-child {
  display: grid;
  gap: 0.15rem;
}

.rank-card > div:last-child strong,
.rank-card > div:last-child small {
  display: block;
}

.upcoming-compact {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.upcoming-compact li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-top: 1px solid rgb(102 87 62 / 18%);
}

.upcoming-compact time {
  color: var(--muted);
  font-size: 0.78rem;
}

.upcoming-compact strong {
  font-size: 0.9rem;
  white-space: nowrap;
}

.achievement-card {
  display: grid;
  grid-template-rows: auto 3rem 4.5rem;
  gap: 0.35rem;
  width: min(100%, 12rem);
  height: 17.5rem;
  padding: 0.5rem;
  border: 1px solid #9d7639;
  border-radius: 0.75rem;
  background: #f1dfb8;
  box-shadow: 0 0.35rem 0.7rem rgb(72 50 23 / 16%);
}

.achievement-card__image,
.achievement-card__title,
.achievement-card__description {
  border: 1px solid #ad8241;
  border-radius: 0.55rem;
  background: #f8edd5;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%);
}

.achievement-card__image {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
}

.achievement-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-card__title,
.achievement-card__description {
  display: grid;
  place-items: center;
  padding: 0.4rem 0.55rem;
  text-align: center;
}

.achievement-card h2,
.achievement-card p {
  margin: 0;
}

.achievement-card h2 {
  display: -webkit-box;
  overflow: hidden;
  font-family: "Dela Gothic One", sans-serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.achievement-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.achievement-card--locked .achievement-card__image {
  display: grid;
  place-items: center;
  background: #f1dfb8;
}

.achievement-card--locked {
  filter: grayscale(1);
}

.achievement-card--locked .achievement-card__image img {
  width: 62%;
  height: 62%;
  mix-blend-mode: multiply;
}

.achievement-grid {
  grid-template-columns: 12rem;
  align-items: stretch;
  justify-content: center;
  gap: 0.85rem;
}

.achievement-toast-region {
  position: fixed;
  z-index: 80;
  top: 1rem;
  right: 1rem;
  display: grid;
  gap: 0.5rem;
  width: min(20rem, calc(100% - 2rem));
  pointer-events: none;
}

.achievement-toast {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid #9d7639;
  border-radius: 0.75rem;
  background: #f1dfb8;
  box-shadow: 0 0.55rem 1rem rgb(34 27 18 / 28%);
  animation: achievement-toast-in 220ms ease-out both;
}

.achievement-toast img {
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid #ad8241;
  border-radius: 0.5rem;
  object-fit: contain;
  background: #f8edd5;
}

.achievement-toast div {
  display: grid;
  gap: 0.15rem;
}

.achievement-toast small {
  color: var(--muted);
}

.achievement-toast strong {
  font-family: "Dela Gothic One", sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
}

@keyframes achievement-toast-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@media (min-width: 40rem) {
  .achievement-grid {
    grid-template-columns: repeat(2, 12rem);
  }
}

@media (min-width: 64rem) {
  .achievement-grid {
    grid-template-columns: repeat(3, 12rem);
  }
}

@media (max-width: 39.99rem) {
  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .achievement-card {
    width: 100%;
    height: 15rem;
    grid-template-rows: auto 2.75rem 4rem;
    gap: 0.3rem;
    padding: 0.4rem;
  }

  .achievement-card__image {
    aspect-ratio: auto;
  }

  .achievement-card h2 {
    font-size: 0.66rem;
  }

  .achievement-card p {
    font-size: 0.65rem;
  }
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

@media (max-width: 55.99rem) {
  body.role-manager,
  body.role-barista,
  body.role-master {
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
  }

  .site-header {
    position: fixed;
    z-index: 40;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0.25rem max(0.25rem, env(safe-area-inset-right))
      max(0.25rem, env(safe-area-inset-bottom))
      max(0.25rem, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid rgb(255 255 255 / 12%);
    border-radius: 0;
    background: rgb(47 54 35 / 97%);
    box-shadow: 0 -0.45rem 1.1rem rgb(29 31 20 / 22%);
  }

  .header-actions,
  .role-barista .header-actions,
  .role-master .header-actions {
    display: grid;
    grid-auto-columns: minmax(3.25rem, 1fr);
    grid-auto-flow: column;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions a,
  .header-actions .link-button,
  .role-barista .header-actions a,
  .role-barista .header-actions .link-button,
  .role-master .header-actions a,
  .role-master .header-actions .link-button {
    display: flex;
    width: auto;
    min-width: 3.25rem;
    min-height: 3.5rem;
    padding: 0.35rem 0.15rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.1rem;
    border-radius: 0.5rem;
    color: #e6e1d0;
    font-size: 0.68rem;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
  }

  .header-actions a .nav-icon {
    font-size: 1rem;
    line-height: 1;
  }

  .header-actions a.active {
    color: #fff8e9;
    background: var(--terracotta);
  }

  .logout-button svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .page {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
    padding: 0.9rem;
  }

  h1 {
    font-size: 2rem;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-grid > section {
    min-width: 0;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .table-scroll table {
    min-width: 43rem;
  }

  .week-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .week-nav .secondary-button {
    min-width: 0;
  }

  .schedule-actions .button,
  .schedule-actions .secondary-button {
    width: 100%;
  }

  .schedule-scroll {
    max-height: calc(100dvh - 13.5rem);
    overscroll-behavior: contain;
  }

  .schedule-table {
    min-width: 73.5rem;
  }

  .schedule-table th:first-child {
    width: 7rem;
    min-width: 7rem;
  }

  .schedule-table td {
    width: 9.5rem;
    min-width: 9.5rem;
  }

  .timesheet-scroll table {
    min-width: 36rem;
  }

  .button,
  .secondary-button,
  input,
  select {
    min-height: 2.75rem;
  }

  input,
  select {
    font-size: 1rem;
  }

  .employee-editor summary,
  .icon-button,
  .slot-card .correction-editor summary {
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .slot-card .correction-editor summary {
    top: 0.35rem;
    right: 0.35rem;
  }

  .slot-card .cell-form .button,
  .slot-card .cell-form .secondary-button,
  .slot-card .compact-times input {
    min-height: 2.75rem;
    font-size: 1rem;
  }

  .request-actions > button {
    flex: 1 1 8rem;
  }

  .counter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .counter-form input {
    width: 100%;
  }

  .counter-form button {
    grid-column: 1 / -1;
  }

  .employee-hero {
    min-height: 0;
    padding: 1rem;
  }

  .rank-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .rank-ring {
    width: 6rem;
    height: 6rem;
  }

  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card {
    min-height: 0;
  }
}

@media (max-width: 30rem) {
  .header-actions {
    grid-auto-columns: minmax(2.75rem, 1fr);
  }

  .header-actions a,
  .header-actions .link-button,
  .role-barista .header-actions a,
  .role-barista .header-actions .link-button,
  .role-master .header-actions a,
  .role-master .header-actions .link-button {
    min-width: 2.75rem;
    padding-inline: 0.1rem;
  }

  .header-actions .nav-label {
    display: none;
  }

  .header-actions a .nav-icon {
    font-size: 1.25rem;
  }
}

@media (min-width: 36rem) and (max-width: 55.99rem) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card--upcoming {
    grid-column: 1 / -1;
  }
}

@media (pointer: coarse) {
  .button,
  .secondary-button,
  .icon-button,
  summary,
  .header-actions a,
  .header-actions .link-button {
    min-height: 2.75rem;
  }
}

.stats-grid--metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.stat-card--metric {
  width: 100%;
  min-width: 0;
  min-height: 10rem;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.stat-card--metric progress {
  width: min(100%, 10rem);
  background: #d8cbb7;
  box-shadow: inset 0 0.08rem 0.2rem rgb(53 43 30 / 16%);
}

.stat-card--metric progress::-webkit-progress-bar {
  background: #d8cbb7;
}

.stat-card--metric progress::-webkit-progress-value {
  background: var(--terracotta);
}

.stat-card--metric progress::-moz-progress-bar {
  background: var(--terracotta);
}

.stat-card--upcoming {
  width: 100%;
  margin-bottom: 1.5rem;
}

@media (min-width: 48rem) {
  .stat-card--metric {
    width: min(100%, 17rem);
    min-height: auto;
    aspect-ratio: 1;
    justify-self: center;
    padding: 2rem;
    border-radius: 50%;
  }
}

@media (max-width: 47.99rem) {
  .stats-grid--metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

.external-cafe {
  display: block;
  margin-top: 0.25rem;
  color: #77432e;
  font-size: 0.7rem;
  line-height: 1.25;
}

.market-icon {
  position: relative;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 0;
  color: #673b1c;
  background: transparent;
  cursor: pointer;
}

.market-icon::before {
  position: absolute;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid #a7773a;
  border-radius: 50%;
  background: #f6d798;
  content: "";
}

.market-icon svg,
.nav-icon svg {
  position: relative;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assigned-shift .market-icon {
  position: absolute;
  right: 0.05rem;
  bottom: 0.05rem;
}

.personal-schedule-table .assigned-shift {
  grid-template-areas:
    "label"
    "time"
    "details"
    "statuses"
    "actions";
  grid-template-rows: 0.9rem 1.3rem minmax(0, auto) 3rem 1.8rem;
  min-height: 8.75rem;
  align-content: start;
  gap: 0.2rem;
}

.personal-schedule-table .assigned-shift__label {
  grid-area: label;
}

.personal-schedule-table .assigned-shift__time {
  grid-area: time;
  align-self: center;
}

.assigned-shift__details {
  min-width: 0;
}

.shift-actions {
  width: 100%;
  margin-top: 0.25rem;
}

.shift-statuses {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-width: 0;
}

.shift-statuses .status {
  max-width: 100%;
  margin: 0;
}

.personal-schedule-table .assigned-shift__details {
  grid-area: details;
}

.personal-schedule-table .shift-actions {
  display: contents;
}

.personal-schedule-table .shift-statuses {
  grid-area: statuses;
  grid-template-rows: 1.55rem 1.15rem;
  gap: 0.15rem;
}

.personal-schedule-table .shift-statuses .status {
  grid-row: 1;
}

.personal-schedule-table .shift-statuses .market-state {
  grid-row: 2;
  max-width: 100%;
}

.shift-icon-stack {
  position: absolute;
  z-index: 2;
  top: 2.55rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.personal-schedule-table .shift-icon-stack {
  position: static;
  grid-area: actions;
  flex-direction: row;
  justify-content: center;
  align-self: end;
  width: 100%;
  min-height: 1.8rem;
}

.assigned-shift .shift-icon-stack .market-icon,
.assigned-shift .shift-icon-stack .correction-status-icon {
  position: static;
  flex: 0 0 auto;
}

.assigned-shift .shift-icon-stack .market-icon {
  width: 1.8rem;
  height: 1.8rem;
  min-height: 1.8rem;
}

.slot-card .preference-block,
.slot-card .assigned-shift,
.slot-card .shift-empty {
  justify-items: center;
  text-align: center;
}

.slot-card .shift-empty {
  display: grid;
  min-height: 3.75rem;
  margin: 0;
  place-items: center;
}

.personal-schedule-table .slot-card .shift-empty {
  min-height: 7rem;
}

.market-state {
  display: block;
  overflow: hidden;
  color: #77512a;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-compact li {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.market-grid {
  display: grid;
  gap: 1rem;
}

.market-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #cdbb9e;
  border-radius: 1rem;
  background: linear-gradient(145deg, #faf2e3, #eee1ce);
  box-shadow: var(--shadow);
}

.market-card h2 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.1rem;
}

.market-card p {
  margin: 0.75rem 0 0;
}

.market-card__time {
  font-size: 1.35rem;
}

.market-card__actions {
  display: grid;
  gap: 0.5rem;
  align-content: end;
}

.market-contacts {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 48%);
}

.market-contacts div {
  display: grid;
  gap: 0.2rem;
}

.market-contacts span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.market-contacts a {
  width: fit-content;
  color: #713921;
}

.profile-layout {
  display: grid;
  gap: 1rem;
}

.profile-media {
  display: grid;
  gap: 1rem;
}

.profile-media h2 {
  margin: 0;
}

.profile-media__preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.profile-media-item {
  position: relative;
}

.profile-media-item--avatar {
  width: 5rem;
  height: 5rem;
}

.profile-media-item--hero {
  min-width: 0;
}

.profile-avatar {
  width: 5rem;
  height: 5rem;
  border: 0.25rem solid rgb(255 255 255 / 75%);
  border-radius: 50%;
  box-shadow: 0 0 1rem rgb(255 255 255 / 95%);
}

.profile-hero-preview {
  position: relative;
  display: grid;
  min-height: 7rem;
  place-items: center;
  overflow: hidden;
  border-radius: 1rem;
  background-image:
    linear-gradient(120deg, rgb(240 226 205 / 42%), rgb(67 54 35 / 24%)),
    url("/static/images/rug-pattern.webp");
  background-position: center;
  background-size: auto, cover;
}

.profile-hero-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgb(240 226 205 / 32%), rgb(67 54 35 / 18%));
  content: "";
  pointer-events: none;
}

.profile-hero-image {
  width: 100%;
  height: 100%;
  min-height: 7rem;
  object-fit: cover;
}

.profile-hero-logo {
  position: relative;
  z-index: 1;
  width: 4rem;
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.78;
}

.profile-image-form {
  position: absolute;
  z-index: 2;
  margin: 0;
}

.profile-media-item--avatar .profile-image-form {
  right: -0.1rem;
  bottom: -0.1rem;
}

.profile-media-item--hero .profile-image-form {
  top: 0.5rem;
  right: 0.5rem;
}

.profile-media-edit,
.profile-media-remove {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid #b9aa91;
  border-radius: 50%;
  color: #6f3824;
  background: #f4ead8;
  box-shadow: 0 0.2rem 0.5rem rgb(57 42 26 / 22%);
  cursor: pointer;
}

.profile-media-remove {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  right: 3rem;
  padding: 0;
}

.profile-media-remove:hover {
  color: #8a2f25;
}

.profile-media-edit svg,
.profile-media-remove svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-image-input:focus-visible + .profile-media-edit {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.profile-media-remove:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.transfer-editor summary {
  font-size: 1.25rem;
}

@media (min-width: 42rem) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 64rem) {
  .market-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 56rem) {
  .personal-schedule-table.schedule-table--schedule {
    min-width: 85rem;
  }
}

@media (min-width: 36rem) and (max-width: 55.99rem) {
  .personal-schedule-table .assigned-shift {
    min-height: 8.75rem;
  }

  .slot-card .correction-editor summary,
  .personal-schedule-table .slot-card .correction-editor summary {
    top: 0.05rem;
    right: 0.05rem;
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .slot-card .correction-editor summary::after {
    position: absolute;
    inset: 50% auto auto 50%;
    display: block;
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid #b9aa91;
    border-radius: 0.35rem;
    background: #f4ead8;
    box-shadow: 0 0.2rem 0.45rem rgb(57 42 26 / 14%);
    content: "";
    transform: translate(-50%, -50%);
  }

  .slot-card .correction-editor summary svg {
    position: relative;
    z-index: 1;
    width: 0.75rem;
    height: 0.75rem;
  }

  .slot-card .correction-editor[open] summary {
    background: transparent;
  }

  .slot-card .correction-editor[open] summary::after {
    border-color: var(--terracotta);
    background: var(--terracotta);
  }

  .correction-status-icon {
    top: auto;
    right: auto;
    bottom: 0.7rem;
    left: 0.7rem;
    width: 1.45rem;
    height: 1.45rem;
  }

  .correction-status-icon--pending {
    padding: 0;
  }

  .correction-status-icon svg {
    width: 0.75rem;
    height: 0.75rem;
  }

  .assigned-shift .shift-icon-stack .market-icon {
    width: 1.45rem;
    height: 1.45rem;
    min-height: 1.45rem;
  }

  .market-icon::before {
    width: 1.45rem;
    height: 1.45rem;
  }

  .market-icon svg {
    width: 0.75rem;
    height: 0.75rem;
  }
}

@media (max-width: 35.99rem) {
  .slot-card .correction-editor summary {
    top: 0.35rem;
    right: 0.35rem;
    width: 1.8rem;
    min-width: 1.8rem;
    height: 1.8rem;
    min-height: 1.8rem;
  }

}

.personal-schedule-table .slot-card .correction-editor summary {
  top: -0.5rem;
  right: -0.25rem;
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.personal-schedule-table .slot-card .correction-editor summary::after {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid #b9aa91;
  border-radius: 0.4rem;
  background: #f4ead8;
  box-shadow: 0 0.2rem 0.45rem rgb(57 42 26 / 14%);
  content: "";
  transform: translate(-50%, -50%);
}

.personal-schedule-table .slot-card .correction-editor summary svg {
  position: relative;
  z-index: 1;
  width: 0.8rem;
  height: 0.8rem;
}

.personal-schedule-table .slot-card .correction-editor[open] summary {
  background: transparent;
}

.personal-schedule-table .slot-card .correction-editor[open] summary::after {
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.timesheet-scroll {
  border-radius: 0;
  background: #fff;
}

.timesheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #222;
  background: #fff;
}

.timesheet-table th,
.timesheet-table td {
  height: 4.75rem;
  padding: 0.5rem;
  border-right: 1px solid #d8dde2;
  border-bottom: 1px solid #d8dde2;
  color: #222;
  background: #fff;
  font-size: 0.9rem;
  text-align: center;
  text-transform: none;
  vertical-align: top;
}

.timesheet-table thead th,
.timesheet-table tfoot th {
  z-index: 6;
  height: 3.25rem;
  color: #202428;
  background: #d9d9d9;
  font-weight: 700;
  vertical-align: middle;
}

.timesheet-table thead th {
  top: 0;
}

.timesheet-table tfoot th {
  position: sticky;
  top: auto;
  bottom: 0;
}

.timesheet-table .timesheet-name {
  position: sticky;
  left: 0;
  width: 13.5rem;
  min-width: 13.5rem;
  text-align: left;
}

.timesheet-table .timesheet-date {
  position: sticky;
  left: 13.5rem;
  width: 6.5rem;
  min-width: 6.5rem;
}

.timesheet-table .timesheet-rate {
  position: sticky;
  left: 20rem;
  width: 5rem;
  min-width: 5rem;
}

.timesheet-table thead .timesheet-name,
.timesheet-table thead .timesheet-date,
.timesheet-table thead .timesheet-rate,
.timesheet-table tfoot .timesheet-name,
.timesheet-table tfoot .timesheet-date,
.timesheet-table tfoot .timesheet-rate {
  z-index: 8;
  background: #d9d9d9;
}

.timesheet-table tbody .timesheet-name {
  z-index: 3;
  top: auto;
  font-size: 1rem;
  font-weight: 700;
}

.timesheet-table tbody .timesheet-date,
.timesheet-table tbody .timesheet-rate {
  z-index: 3;
}

.timesheet-table .timesheet-day {
  width: 3rem;
  min-width: 3rem;
}

.timesheet-table td.timesheet-day span,
.timesheet-table td.timesheet-day strong {
  display: block;
  line-height: 1.4;
}

.timesheet-table .timesheet-total {
  width: 4rem;
  min-width: 4rem;
}

.timesheet-table .timesheet-pay {
  width: 7rem;
  min-width: 7rem;
  white-space: nowrap;
}

@media (max-width: 35.99rem) {
  .timesheet-table .timesheet-name {
    width: 9rem;
    min-width: 9rem;
  }

  .timesheet-table tbody .timesheet-date,
  .timesheet-table tbody .timesheet-rate {
    position: static;
  }

  .timesheet-table thead .timesheet-date,
  .timesheet-table thead .timesheet-rate,
  .timesheet-table tfoot .timesheet-date,
  .timesheet-table tfoot .timesheet-rate {
    left: auto;
  }
}

.request-row--decision {
  grid-template-columns: minmax(0, 1fr);
}

.request-decision-line {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
}

.request-decision-line .request-comparison {
  margin: 0;
}

.request-decision-line .request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(7.5rem, 1fr));
  align-items: stretch;
}

.preference-randomizer-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0.75rem 0;
}

.market-filters {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 0 1.2rem rgb(255 255 255 / 24%);
}

.market-filters label {
  display: grid;
  flex: 1;
  gap: 0.3rem;
}

.dice-button {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}

.dice-button svg {
  width: 1.5rem;
  height: 1.5rem;
}

.dice-button .dice-face {
  fill: currentColor;
  stroke: none;
}

.dice-button svg circle {
  fill: #fffaf0;
}

.preference-randomizer-dialog .stack {
  margin-top: 1rem;
}

.preference-randomizer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.summary-scroll {
  max-height: min(70vh, 48rem);
  overflow: auto;
  border-radius: 1rem;
  box-shadow: 0 0 1.25rem rgb(255 255 255 / 28%);
}

.summary-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgb(255 255 255 / 94%);
}

.summary-table th,
.summary-table td {
  min-width: 5.3rem;
  padding: 0.65rem;
  border-right: 1px solid rgb(50 59 39 / 12%);
  border-bottom: 1px solid rgb(50 59 39 / 12%);
  text-align: center;
  vertical-align: middle;
}

.summary-table thead th,
.summary-table tfoot th {
  position: sticky;
  z-index: 4;
  background: #eee9df;
}

.summary-table thead th {
  top: 0;
}

.summary-table tfoot th {
  bottom: 0;
}

.summary-table thead span,
.summary-table thead strong,
.summary-name span,
.summary-name strong {
  display: block;
}

.summary-table .summary-name {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 12rem;
  min-width: 12rem;
  background: #f7f3eb;
  text-align: left;
}

.summary-table thead .summary-name,
.summary-table tfoot .summary-name {
  z-index: 6;
  background: #eee9df;
}

.summary-name span,
.summary-day small {
  color: #65705a;
  font-size: 0.72rem;
}

.summary-day {
  position: relative;
}

.summary-day input[type="number"] {
  width: 4.2rem;
  min-width: 0;
  margin-top: 0.25rem;
  padding: 0.45rem 0.3rem;
  text-align: center;
}

.summary-bonus {
  width: 6rem;
  min-width: 0;
}

.payroll-comment-edit,
.payroll-comment-view {
  display: inline-grid;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.3rem auto 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #69705f;
  background: transparent;
}

.payroll-comment-edit.has-comment,
.payroll-comment-view {
  color: #554427;
  background: #ead29a;
}

.payroll-comment-edit svg,
.payroll-comment-view svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.timesheet-day .payroll-comment-view {
  display: grid;
}

.payroll-comment-dialog label {
  display: grid;
  gap: 0.45rem;
}

.summary-save {
  min-width: 0;
  padding-inline: 0.75rem;
}

@media (max-width: 47.99rem) {
  .market-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .market-filters button {
    grid-column: 1 / -1;
  }

  .preference-randomizer-bar {
    justify-content: stretch;
  }

  .dice-button {
    justify-content: center;
    width: 100%;
  }

  .summary-scroll {
    margin-inline: -0.75rem;
    border-radius: 0;
  }

  .summary-table .summary-name {
    width: 8rem;
    min-width: 8rem;
  }

  .summary-table th,
  .summary-table td {
    min-width: 4.8rem;
    padding: 0.45rem;
  }
}

.request-decision-line .request-actions > button {
  height: 100%;
}

@media (min-width: 48rem) {
  .request-decision-line {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 18rem);
  }
}

.week-comment-form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.week-comment-form label {
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: none;
}

.week-comment-form textarea,
.preference-form textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem;
  resize: vertical;
  border: 1px solid #b9aa91;
  border-radius: 0.55rem;
  color: var(--ink);
  background: rgb(255 255 255 / 76%);
  font: inherit;
  font-size: 0.75rem;
}

.week-comment-form .secondary-button {
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
}

.schedule-table tbody th .week-comment-note {
  margin: 0.75rem 0 0;
  padding: 0.55rem;
  border-radius: 0.55rem;
  color: #55482f;
  background: #f4ead8;
  font-size: 0.7rem;
  line-height: 1.35;
  text-transform: none;
}

.preference-block {
  position: relative;
}

.preference-comment-button {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid #a98b5f;
  border-radius: 50%;
  color: #6f5632;
  background: #fff9eb;
  box-shadow: 0 0.2rem 0.45rem rgb(57 42 26 / 14%);
  cursor: pointer;
  transform: translateY(-50%);
}

.preference-comment-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preference-block:has(.preference-comment-button) {
  padding-right: 3rem;
}

.schedule-table--schedule:not(.personal-schedule-table) .preference-comment-button {
  top: 2.75rem;
  right: 0.55rem;
  left: auto;
  transform: none;
}

.schedule-table--schedule:not(.personal-schedule-table) .preference-block:has(.preference-comment-button) {
  padding-right: 3.25rem;
  padding-left: 0.65rem;
  min-height: 5rem;
}

.preference-comment-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 1.25rem;
  border: 1px solid #b99b69;
  border-radius: 1rem;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 0 1rem 3rem rgb(38 28 19 / 24%);
}

.preference-comment-dialog::backdrop {
  background: rgb(31 27 23 / 42%);
  backdrop-filter: blur(0.2rem);
}

.preference-comment-dialog form {
  float: right;
}

.preference-comment-dialog form button {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #f1e5d1;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.preference-comment-dialog h2 {
  margin: 0 2.5rem 0.75rem 0;
  font-size: 1.1rem;
}

.preference-comment-dialog p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 35.99rem) {
  .week-comment-form label,
  .week-comment-form textarea,
  .schedule-table tbody th .week-comment-note {
    font-size: 0.62rem;
  }

  .week-comment-form .secondary-button {
    min-height: 1.8rem;
    padding-inline: 0.25rem;
  }
}

/* Phone layout: keep daily editing spacious and management lists readable. */
.week-comment-panel {
  margin: 0.75rem 0;
  padding: 0.8rem;
  border: 1px solid #cdbb9e;
  border-radius: 0.9rem;
  background: rgb(255 250 240 / 78%);
  box-shadow: var(--shadow);
}

.week-comment-panel .week-comment-form {
  margin: 0;
}

.week-comment-panel .week-comment-form label,
.week-comment-panel .week-comment-form textarea {
  font-size: 0.82rem;
}

.week-comment-panel .week-comment-form .secondary-button {
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
}

.schedule-swipe-hint {
  display: none;
}

@media (max-width: 35.99rem) {
  .page-heading {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .schedule-scroll:has(.personal-schedule-table) {
    max-height: none;
    scroll-padding-inline: 0;
    scroll-snap-type: x mandatory;
  }

  .schedule-swipe-hint {
    display: block;
    margin: -0.25rem 0 0.5rem;
    color: var(--muted);
    font-size: 0.74rem;
    text-align: right;
  }

  .personal-schedule-table {
    width: max-content;
    min-width: 0;
  }

  .personal-schedule-table th:first-child,
  .personal-schedule-table tbody th:first-child {
    display: none;
  }

  .personal-schedule-table thead th:not(:first-child),
  .personal-schedule-table td {
    width: calc(100vw - 3.1rem);
    min-width: calc(100vw - 3.1rem);
    max-width: calc(100vw - 3.1rem);
  }

  .personal-schedule-table td {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .personal-schedule-table .slot-card {
    min-height: 9rem;
  }

  .personal-schedule-table .slot-card .compact-times {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .personal-schedule-table .slot-card .compact-times > div {
    grid-template-columns: 1.35rem minmax(0, 1fr);
  }

  .personal-schedule-table .slot-card .cell-form {
    padding: 0.8rem;
  }

  .schedule-scroll:has(.team-preferences-table) {
    scroll-padding-inline: 7rem;
    scroll-snap-type: none;
  }

  .team-preferences-table {
    min-width: 73.5rem;
  }

  .team-preferences-table th:first-child,
  .team-preferences-table tbody th:first-child {
    display: table-cell;
    width: 7rem;
    min-width: 7rem;
  }

  .team-preferences-table thead th:not(:first-child),
  .team-preferences-table td {
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: none;
  }

  .team-preferences-table td {
    scroll-snap-align: none;
  }

  #team-table {
    width: 100%;
    min-width: 0;
  }

  #team-table thead {
    display: none;
  }

  #team-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  #team-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 1rem;
    padding: 0.9rem;
    border: 1px solid #d2c4af;
    border-radius: 0.9rem;
    background: rgb(255 250 240 / 76%);
    box-shadow: 0 0.3rem 0.8rem rgb(55 43 27 / 10%);
  }

  #team-table td {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  #team-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
  }

  #team-table td:first-child,
  #team-table td:last-child {
    grid-column: 1 / -1;
  }

  #team-table td:first-child {
    font-size: 1.05rem;
    font-weight: 600;
  }

  #team-table td:first-child::before {
    display: none;
  }

  #team-table .employee-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    justify-content: end;
    width: 100%;
  }

  #team-table .employee-editor,
  #team-table .icon-button {
    justify-self: end;
  }

  #team-table .employee-editor[open] {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  #team-table .employee-editor[open] .cell-form {
    width: 100%;
    min-width: 0;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: #efe5d3;
  }
}

@media (max-width: 30rem) {
  .market-filters {
    grid-template-columns: 1fr;
  }

  .market-filters button {
    grid-column: 1;
  }

  .profile-media__preview {
    grid-template-columns: 1fr;
  }

  .profile-media-item--avatar {
    justify-self: center;
  }

  .profile-media-edit,
  .profile-media-remove {
    width: 2.75rem;
    height: 2.75rem;
  }

  .request-comparison {
    gap: 0.35rem;
  }

  .request-comparison > div {
    padding-inline: 0.45rem;
  }
}
