:root {
  color-scheme: light;
  font-family: Inter, Roboto, system-ui, sans-serif;
  color: #142a30;
  background: #eef2f2;
  line-height: 1.5;
  --ink: #142a30;
  --muted: #53686b;
  --line: #d5dfdf;
  --surface: #fff;
  --accent: #14594f;
  --tint: #e5f1ec;
  --danger: #a13229;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.page {
  width: min(100%, 640px);
  margin-inline: auto;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(30px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 44px; margin-bottom: 20px; }
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.home-tile { display: flex; flex-direction: column; justify-content: flex-start; gap: 5px; text-align: start; min-height: 104px; padding: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); overflow-wrap: anywhere; }
.home-tile strong { font-size: clamp(16px, 4vw, 20px); line-height: 1.2; }
.home-tile .meta { color: inherit; opacity: .85; }
.schedule-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.schedule-results, .schedule-imports { display: grid; gap: 10px; }
.schedule-imports { margin-top: 16px; }
.schedule-line { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.schedule-line:last-child { border-bottom: 0; }
.schedule-line span { overflow-wrap: anywhere; }
.room-shift { min-width: 0; padding: 0; }
.room-shift-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 14px; font-weight: 700; list-style: none; cursor: pointer; }
.room-shift-summary::-webkit-details-marker { display: none; }
.room-shift-summary::after { content: ''; flex: 0 0 8px; width: 8px; height: 8px; margin-right: 3px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.room-shift[open] .room-shift-summary::after { transform: rotate(225deg); }
.room-shift-summary:focus-visible { outline: 3px solid #399786; outline-offset: -3px; border-radius: 12px; }
.room-shift-body { padding: 0 14px 10px; }
.schedule-imports .panel { overflow-wrap: anywhere; }
.brand { display: flex; gap: 9px; align-items: center; font-size: 14px; font-weight: 750; }
.brand-icon { border-radius: 8px; display: grid; place-items: center; height: 28px; width: 28px; background: var(--accent); color: white; }
h1 { font-size: clamp(27px, 7vw, 37px); line-height: 1.15; letter-spacing: -.035em; margin: 0 0 12px; overflow-wrap: anywhere; }
h2 { font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 10px; overflow-wrap: anywhere; }
.subtle, .meta { color: var(--muted); font-size: 14px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.heading h1 { margin-bottom: 4px; }
.heading p { margin: 0; }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; min-height: 44px; border: 1px solid transparent; padding: 8px 14px; border-radius: 9px; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #399786; outline-offset: 2px; }
.primary { background: var(--accent); color: white; font-weight: 650; }
.quiet { color: var(--accent); background: var(--surface); border-color: var(--line); font-weight: 600; }
.danger { color: var(--danger); background: #fff; border-color: #efd1ca; }
.back { margin-bottom: 14px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: #dfe8e7; margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--muted); font-weight: 650; }
.tabs [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #12292d15; }
.rows { display: grid; gap: 9px; }
.order-hint { margin-bottom: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.row, .panel, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.row { width: 100%; text-align: left; display: grid; gap: 7px; color: var(--ink); }
.task-item { position: relative; overflow: hidden; border-radius: 13px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.task-item .row { position: relative; transform: translateX(var(--swipe-offset, 0px)); }
.task-item .row:focus-visible { outline-offset: -3px; }
.can-reorder .row, .task-lifted .row { padding-inline-end: 39px; }
.task-swipe-action { position: absolute; inset: 0; display: flex; align-items: center; padding-inline: 12px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 650; visibility: hidden; pointer-events: none; }
.swipe-left .task-swipe-action { justify-content: flex-end; background: #36515a; }
.task-swiping .task-swipe-action { visibility: visible; opacity: .78; }
.task-swipe-ready .task-swipe-action { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .task-swipe-returning .row { transition: transform 250ms cubic-bezier(.22, .65, .32, 1); }
  .task-swipe-returning .task-swipe-action { visibility: visible; opacity: .78; }
}
.order-grip { position: absolute; inset-inline-end: 16px; top: calc(50% - 8px); width: 10px; height: 15px; background-image: radial-gradient(circle, #607477 1.3px, transparent 1.55px); background-size: 5px 5px; pointer-events: none; }
.task-chosen .row { border-color: #399786; }
.task-placeholder .row { border-style: dashed; background: var(--tint); }
.task-lifted { box-shadow: 0 8px 24px #142a3040; cursor: grabbing; }
.row strong { overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.label { display: inline-flex; color: var(--accent); background: var(--tint); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.label.overdue { color: #922d24; background: #f9e6e1; }
.label.completed { color: #36515a; background: #e9eff2; }
.empty { color: var(--muted); }
.error { color: var(--danger); background: #fbebe7; border-radius: 8px; padding: 10px 12px; }
.message { margin-top: 12px; }
.message:empty { display: none; }
.stack, fieldset { display: grid; gap: 12px; }
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
label { display: grid; gap: 5px; font-weight: 600; }
input, textarea, select { width: 100%; min-width: 0; max-width: 100%; color: var(--ink); border: 1px solid #b7c8c7; border-radius: 8px; background: #fff; padding: 10px; min-height: 44px; }
textarea { min-height: calc(18em + 22px); resize: vertical; }
.description-section { display: grid; gap: 5px; min-width: 0; }
.description-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.description-heading h2 { margin: 0; }
.description-text { min-height: calc(4.5em + 22px); padding: 10px; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.description-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.deadline-fields, .profile-class-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
input[type="file"] { font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.file:last-child { border-bottom: 0; }
.file .actions { gap: 6px; }
.panel .subtle { margin: 0; }
.file-preview { width: min(calc(100% - 24px), 760px); max-height: calc(100dvh - 30px); padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); }
.file-preview::backdrop { background: #142a3080; }
.preview-heading { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: start; margin: -14px -14px 0; padding: 14px 14px 10px; background: var(--surface); }
.preview-heading h2 { margin: 0; padding-block: 8px; overflow-wrap: anywhere; }
.preview-close { width: 44px; height: 44px; padding: 0; font-size: 26px; font-weight: 400; line-height: 1; }
.preview-content { margin-bottom: 12px; }
.preview-content img, .preview-content video { display: block; max-width: 100%; max-height: 64dvh; margin-inline: auto; object-fit: contain; }
.preview-content audio { max-width: 100%; }
.preview-content canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.pdf-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pdf-navigation[hidden] { display: none; }
.file-text { max-height: 58dvh; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.file-grid { max-height: 58dvh; margin-top: 6px; overflow: auto; }
.file-grid table { border-collapse: collapse; font-size: 14px; }
.file-grid td { min-width: 54px; max-width: 220px; padding: 5px 8px; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
@media (hover: hover) {
  .row:hover { border-color: #82a9a1; }
  .quiet:hover { background: var(--tint); }
}
