:root {
  --app-height: 100svh;
  --bg: #f6f0e8;
  --surface: rgba(255, 252, 247, 0.92);
  --surface-strong: #fffaf2;
  --ink: #1d2b24;
  --muted: #59665f;
  --line: rgba(29, 43, 36, 0.12);
  --accent: #1d6b57;
  --accent-strong: #145243;
  --accent-soft: #d9efe6;
  --warning: #d77835;
  --warning-soft: #ffe8d3;
  --danger: #b4452c;
  --danger-soft: #f9ddd6;
  --shadow: 0 18px 40px rgba(49, 39, 25, 0.08);
  --radius: 22px;
  --radius-small: 14px;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Georgia", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(215, 120, 53, 0.18), transparent 28%),
    linear-gradient(180deg, #f7efe3 0%, #f3eee8 48%, #eef2ed 100%);
  color: var(--ink);
}

html {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  position: relative;
  min-height: var(--app-height);
  height: var(--app-height);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  touch-action: manipulation;
}

html.keyboard-open body {
  min-height: var(--app-height);
  height: auto;
}

.page-glow {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(12px);
  opacity: 0.55;
}

.page-glow-one {
  top: 3rem;
  right: 8%;
  width: 10rem;
  height: 10rem;
  background: rgba(29, 107, 87, 0.12);
  border-radius: 50%;
}

.page-glow-two {
  bottom: 5rem;
  left: 6%;
  width: 8rem;
  height: 8rem;
  background: rgba(215, 120, 53, 0.16);
  border-radius: 50%;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 1.2rem));
  height: var(--app-height);
  margin: 0 auto;
  padding: 1rem 0 max(3rem, calc(env(safe-area-inset-bottom) + 2rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 1rem;
  scroll-padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4rem));
}

html.keyboard-open .app-shell,
html.keyboard-open .login-shell,
html.keyboard-open .app-shell-minimal {
  min-height: var(--app-height);
  height: auto;
  padding-bottom: max(0.9rem, calc(env(safe-area-inset-bottom) + 0.75rem));
}

.topbar {
  position: relative;
  z-index: 40;
  isolation: isolate;
  overflow: visible;
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 0.95rem 0.85rem;
  background: rgba(255, 249, 241, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar h1,
.card h2,
.stat-value {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.topbar h1 {
  font-size: clamp(2rem, 7vw, 2.45rem);
  line-height: 1.02;
}

.topbar-copy {
  min-width: 0;
}

.topbar-copy .muted {
  margin: 0.2rem 0 0;
}

.eyebrow {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.topbar-actions {
  position: relative;
  z-index: 45;
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
  padding-right: 0.1rem;
}

.topbar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: nowrap;
  width: 100%;
}

.topbar-extra {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-extra .button-row {
  margin: 0;
}

.topbar-toolbar > div:first-child:empty {
  display: none;
}

.topbar-extra .button {
  white-space: nowrap;
}

.menu-shell {
  position: relative;
  z-index: 46;
  margin-left: auto;
}

.topbar-actions .menu-shell {
  margin-left: auto;
}

.menu-shell[open] {
  z-index: 80;
}

.menu-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.35rem;
  padding: 0.52rem 0.76rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  user-select: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle-icon {
  display: inline-grid;
  gap: 0.22rem;
}

.menu-toggle-icon span {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-toggle-label {
  font-size: 0.86rem;
  font-weight: 700;
}

.attendance-status-grid {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.attendance-status-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.68rem 0.78rem;
  border-radius: 14px;
  border: 1px solid rgba(29, 43, 36, 0.08);
  background: rgba(29, 43, 36, 0.045);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.attendance-status-item.is-good {
  background: rgba(29, 107, 87, 0.08);
  color: var(--accent-strong);
}

.attendance-status-dot {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.34rem;
  border-radius: 999px;
  background: rgba(113, 126, 118, 0.9);
}

.attendance-status-item.is-good .attendance-status-dot {
  background: var(--accent);
}

.menu-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 0.7rem);
  right: 0;
  width: min(18rem, calc(100vw - 1.6rem));
  padding: 0.8rem;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 251, 246, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.menu-list {
  display: grid;
  gap: 0.55rem;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  color: var(--ink);
  font-size: 1rem;
}

.menu-link::after {
  content: '›';
  color: var(--muted);
}

.menu-link.is-active {
  background: var(--accent-soft);
  border-color: rgba(29, 107, 87, 0.2);
}

.menu-logout {
  margin-top: 0.8rem;
}

.menu-logout-button {
  width: 100%;
}

.language-switcher {
  margin-top: 0.8rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.language-switcher-compact {
  margin-top: 0;
  width: 100%;
}

.page-language-switcher {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.page-language-switcher .language-switcher {
  width: auto;
  min-width: min(18rem, 100%);
  margin-left: auto;
}

.language-switcher-label {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.language-switcher-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.language-link.is-active {
  background: var(--accent-soft);
  border-color: rgba(29, 107, 87, 0.24);
  color: var(--accent-strong);
}

.menu-link.is-active::after {
  color: var(--accent-strong);
}

.menu-logout {
  margin-top: 0.7rem;
}

.menu-logout-button {
  width: 100%;
}

.message {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.message-success {
  background: #eff8f3;
  border-color: rgba(29, 107, 87, 0.18);
}

.message-error {
  background: #fff2ee;
  border-color: rgba(180, 69, 44, 0.24);
}

.grid,
.stats-grid,
.record-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-stats-grid {
  grid-template-columns: 1fr;
}

.card,
.stat-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card {
  padding: 1rem;
  margin-top: 1rem;
}

.card-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: stretch;
  margin-bottom: 0.85rem;
}

.card-actions,
.actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.card-actions {
  width: 100%;
}

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

.stat-card {
  padding: 1rem;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-value {
  margin-top: 0.4rem;
  font-size: 1.8rem;
}

.tone-neutral {
  background: var(--surface);
}

.tone-success {
  background: #eef8f3;
}

.tone-warning {
  background: #fff3e5;
}

.tone-danger {
  background: #fff0eb;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge.tone-neutral {
  background: rgba(29, 43, 36, 0.08);
}

.badge.tone-success {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.tone-warning {
  background: var(--warning-soft);
  color: #8f531d;
}

.badge.tone-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

form {
  display: grid;
  gap: 0.75rem;
}

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

label,
.field-group > span {
  display: grid;
  gap: 0.35rem;
  font-size: 0.94rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  scroll-margin-bottom: 1rem;
}

select {
  padding-right: 2.6rem;
}

input[type='file'] {
  padding: 0.65rem 0.7rem;
}

input[type='file']::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.52rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 107, 87, 0.14);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
}

.upload-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.5rem;
  padding: 0.72rem 0.82rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.upload-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(217, 239, 230, 0.95);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(29, 107, 87, 0.1);
}

.upload-picker-name {
  min-width: 0;
  font-size: 0.96rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-upload-form].has-upload-file .upload-picker-name {
  color: var(--ink);
  font-weight: 600;
}

.upload-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-picker-input::file-selector-button {
  display: none;
}

.upload-picker-hint {
  margin: 0.55rem 0 0;
}

@media (max-width: 480px) {
  .upload-picker {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 0.4rem;
  }

  .upload-picker-name {
    flex: 1 1 100%;
    white-space: normal;
    line-height: 1.35;
  }

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

  .task-topline {
    flex-direction: column;
    align-items: stretch;
  }

  .task-topline .badge {
    align-self: flex-start;
  }
}

textarea {
  min-height: 6rem;
  line-height: 1.45;
  resize: vertical;
}

textarea::-webkit-resizer {
  display: none;
}

.rules-textarea {
  min-height: 7.8rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
  gap: 0.55rem 0.8rem;
}

.checkbox-chip {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.checkbox-chip input {
  width: auto;
  margin: 0;
}

.checkbox-chip-toggle {
  width: 100%;
  justify-content: space-between;
}

.checkbox-chip-toggle input {
  transform: scale(1.15);
}

.field-group {
  display: grid;
  gap: 0.55rem;
}

.field-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.field-group-head span {
  font-weight: 700;
}

.button-inline-control {
  min-height: 2rem;
  padding: 0.34rem 0.72rem;
  border-style: solid;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.specific-date-picker {
  display: grid;
  gap: 0.55rem;
}

.specific-date-picker .muted.small {
  margin: 0;
}

.specific-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.specific-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.3rem;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.specific-date-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(29, 43, 36, 0.12);
  background: rgba(255, 255, 255, 0.98);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.specific-date-empty {
  padding: 0.25rem 0;
}

.bedroom-sort-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(8.9rem, 10.8rem);
  gap: 0.78rem;
  overflow-x: auto;
  padding: 0.05rem 0.75rem 0.25rem 0.15rem;
  margin: 0 -0.15rem;
}

.bedroom-sort-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.bedroom-sort-card.is-active {
  border-color: rgba(29, 107, 87, 0.26);
  background: rgba(217, 239, 230, 0.9);
}

.bedroom-sort-card-media,
.bedroom-card-media {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(29, 107, 87, 0.1);
}

.bedroom-sort-card-media {
  aspect-ratio: 4 / 3;
}

.bedroom-sort-card-media img,
.bedroom-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bedroom-sort-card-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(217, 239, 230, 0.95), rgba(236, 247, 242, 0.92));
  color: var(--accent-strong);
  font-size: 1.7rem;
}

.bedroom-sort-card-copy {
  min-width: 0;
}

.bedroom-sort-card-copy strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
}

.bedroom-card {
  padding: 0;
  overflow: hidden;
}

.bedroom-card-media {
  aspect-ratio: 16 / 7;
  border-radius: 0;
}

.bedroom-card-media-label {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(18, 42, 34, 0.16);
  pointer-events: none;
}

.bedroom-card-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
}

.bedroom-reference-section {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 251, 249, 0.96), rgba(239, 247, 243, 0.88));
  border: 1px solid rgba(29, 107, 87, 0.1);
}

.bedroom-reference-header {
  display: grid;
  gap: 0.3rem;
}

.bedroom-reference-header p {
  margin: 0;
}

.bedroom-reference-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.88rem;
  border-radius: 18px;
  border: 1px solid rgba(29, 43, 36, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.bedroom-reference-panel-head {
  display: grid;
  gap: 0.25rem;
}

.bedroom-reference-panel-head p {
  margin: 0;
}

.bedroom-reference-form {
  display: grid;
  gap: 0.8rem;
}

.room-reference-list {
  gap: 0.7rem;
}

.room-reference-card {
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
}

.room-reference-card-media {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  background: rgba(29, 107, 87, 0.08);
}

.room-reference-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-reference-card-body {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.room-reference-card-body p {
  margin: 0;
}

.room-reference-card-label {
  letter-spacing: 0.01em;
}

.room-reference-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.room-reference-card-path {
  margin: 0;
}

.room-reference-card-copy {
  font-size: 1rem;
  line-height: 1.45;
}

.room-reference-card-focus {
  margin-top: 0.85rem;
  border-color: rgba(29, 107, 87, 0.16);
  background: linear-gradient(180deg, rgba(246, 251, 248, 0.96), rgba(238, 246, 242, 0.92));
}

.maid-room-reference-groups {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.maid-room-reference-group {
  display: grid;
  gap: 0.55rem;
}

.maid-room-reference-header {
  display: grid;
  gap: 0.18rem;
}

.maid-room-reference-title {
  margin: 0;
}

.maid-room-reference-subtitle {
  margin: 0;
}

.room-reference-card-compact {
  padding: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.74rem 1rem;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #2d8570 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-warning {
  background: linear-gradient(135deg, #d28c38 0%, #c96a32 100%);
}

.button-danger {
  background: linear-gradient(135deg, #bc5135 0%, #9f3822 100%);
}

.task-delete-form {
  margin-top: 0.95rem;
}

.button-ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px dashed rgba(29, 107, 87, 0.28);
}

.task-list,
.record-list,
.timeline {
  display: grid;
  gap: 0.8rem;
}

.rules-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.compliance-accept {
  margin-top: 1.9rem;
}

.compliance-dashboard-popup {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(1rem, calc(env(safe-area-inset-top) + 0.8rem)) 1rem max(1.8rem, calc(env(safe-area-inset-bottom) + 1.4rem));
  background: rgba(29, 43, 36, 0.3);
  backdrop-filter: blur(10px);
}

.compliance-dashboard-popup-card {
  width: min(100%, 28rem);
  margin: 0;
}

.compliance-dashboard-popup-copy {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.compliance-dashboard-popup-copy h2,
.compliance-dashboard-popup-copy p {
  margin: 0;
}

.compliance-home-cta {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.rules-list li {
  padding-left: 0.1rem;
}

.task-reorder-note {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.task-reorder-note p {
  margin: 0;
}

[data-task-reorder-status][data-tone="success"] {
  color: var(--accent-strong);
}

[data-task-reorder-status][data-tone="danger"] {
  color: var(--danger);
}

.task-item,
.record-item,
.timeline-item {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.task-topline,
.record-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.task-title {
  margin: 0;
  font-size: 1.05rem;
}

.task-category-row {
  margin-top: 0.45rem;
}

.task-bedroom-row {
  margin-top: 0.42rem;
}

.task-room-extra-row,
.task-proof-row {
  margin-top: 0.42rem;
}

.task-room-extra-field select:disabled {
  opacity: 0.7;
}

.task-room-extra-summary {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(29, 107, 87, 0.16);
  background: linear-gradient(180deg, rgba(247, 251, 249, 0.98), rgba(240, 247, 244, 0.92));
}

.task-room-extra-summary p,
.task-room-extra-summary strong {
  margin: 0;
}

.task-proof-card {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(29, 107, 87, 0.16);
  background: linear-gradient(180deg, rgba(248, 251, 249, 0.98), rgba(240, 247, 244, 0.92));
}

.task-proof-card-compact {
  padding: 0.72rem;
}

.task-proof-card-media {
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 4 / 3;
  background: rgba(29, 107, 87, 0.08);
}

.task-proof-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-proof-card-body {
  display: grid;
  gap: 0.3rem;
}

.task-proof-card-body p {
  margin: 0;
}

.task-proof-card-link a {
  font-weight: 600;
}

.task-completion-proof-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.95rem;
}

.task-sort-item {
  position: relative;
}

.task-template-shell {
  padding: 0;
  overflow: hidden;
}

.task-template-summary {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  cursor: pointer;
  list-style: none;
}

.task-template-summary::-webkit-details-marker {
  display: none;
}

.task-template-summary-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.task-template-summary-main p,
.task-template-summary-note {
  margin: 0.25rem 0 0;
}

.task-template-summary-side {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.task-template-summary-side .meta-row {
  margin: 0;
  justify-content: flex-end;
}

.task-template-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease;
}

.task-template-shell[open] .task-template-chevron {
  transform: rotate(180deg);
  color: var(--accent-strong);
}

.task-template-body {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid rgba(29, 43, 36, 0.08);
}

.task-translation-shell {
  border: 1px solid rgba(29, 43, 36, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.task-translation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  list-style: none;
}

.task-translation-summary::-webkit-details-marker {
  display: none;
}

.task-translation-body {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid rgba(29, 43, 36, 0.08);
}

.task-translation-body .muted.small {
  margin: 0 0 0.7rem;
}

.task-translation-body textarea {
  min-height: 4.75rem;
}

.task-translation-shell[open] .task-template-chevron {
  transform: rotate(180deg);
  color: var(--accent-strong);
}

.task-sort-item.is-dragging {
  box-shadow: 0 18px 40px rgba(49, 39, 25, 0.18);
  opacity: 0.96;
  transform: scale(1.01);
}

.task-sort-placeholder {
  border: 1px dashed rgba(29, 107, 87, 0.32);
  background: rgba(29, 107, 87, 0.08);
}

.task-sort-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.task-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  min-width: 2.8rem;
  min-height: 2.8rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: grab;
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task-meta,
.meta-row,
.inline-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.attendance-badge-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.attendance-badge-row .badge {
  justify-content: flex-start;
  min-height: 2.15rem;
}

.footnote {
  margin-top: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  background: rgba(215, 120, 53, 0.08);
  border: 1px solid rgba(215, 120, 53, 0.18);
}

.split {
  display: grid;
  gap: 1rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(29, 43, 36, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.small {
  font-size: 0.84rem;
}

.centered-shell {
  width: min(460px, calc(100% - 1.2rem));
  margin: 6vh auto 2rem;
}

.app-shell-minimal {
  position: relative;
  width: 100%;
  height: var(--app-height);
  padding: max(0.85rem, env(safe-area-inset-top)) 0 max(1rem, calc(env(safe-area-inset-bottom) + 0.9rem));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.65rem;
}

.minimal-topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem;
  pointer-events: none;
}

.minimal-topbar-left,
.minimal-topbar-right {
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.language-fab-shell {
  position: relative;
  margin-left: auto;
}

.language-fab-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  cursor: pointer;
  box-shadow: var(--shadow);
  user-select: none;
}

.language-fab-toggle::-webkit-details-marker {
  display: none;
}

.language-fab-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.language-fab-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(13rem, calc(100vw - 1.6rem));
  padding: 0.7rem;
  border-radius: calc(var(--radius) - 4px);
  background: rgba(255, 251, 246, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.language-fab-links {
  display: grid;
  gap: 0.45rem;
}

.language-fab-panel .language-link {
  width: 100%;
  justify-content: flex-start;
}

.centered-shell-minimal {
  width: auto;
  min-height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
}

.landing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0.9rem;
  width: min(22rem, 100%);
  margin: 0 auto;
}

.landing-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  padding-inline: 1.3rem;
  font-size: 1rem;
}

.login-shell {
  width: min(980px, calc(100% - 1.2rem));
  height: var(--app-height);
  padding: 0;
}

.login-page {
  min-height: 100%;
  display: grid;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 1.45rem;
  box-shadow: var(--shadow);
}

.login-page-main {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.centered-shell-login {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.centered-shell-login .message,
.centered-shell-login .card {
  margin-top: 0;
}

.empty-state {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(29, 43, 36, 0.2);
  color: var(--muted);
}

a {
  color: var(--accent-strong);
}

@media (min-width: 768px) {
  .app-shell {
    width: min(1120px, calc(100% - 2rem));
    padding-top: 1.4rem;
  }

  .topbar {
    padding: 1.4rem 1.6rem;
  }

  .split {
    grid-template-columns: 1.05fr 0.95fr;
  }

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

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