:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #d9e2ee;
  --text: #1d2733;
  --muted: #667789;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #14855f;
  --green-soft: #e6f7ef;
  --red: #cc3b3b;
  --red-soft: #fdecec;
  --amber: #b7791f;
  --amber-soft: #fff7df;
  --shadow: 0 18px 45px rgba(25, 39, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

.admin-control {
  display: none !important;
}

body.is-admin .admin-control {
  display: revert !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.app-shell.locked {
  display: none;
}

.login-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-gate.hidden {
  display: none;
}

.login-card {
  display: grid;
  width: min(460px, 100%);
  max-width: calc(100vw - 32px);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 26px;
}

#googleButton,
#googleButton > div,
#googleButton iframe {
  max-width: 100%;
}

.login-brand {
  margin-bottom: 4px;
}

.dev-login {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

#loginMessage {
  min-height: 22px;
  color: #9f2d2d;
  font-weight: 700;
  line-height: 1.45;
}

.sidebar {
  background: #10243e;
  color: #f7fbff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #2dd4bf;
  color: #10243e;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #b8c7d9;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c9d6e5;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  min-height: 46px;
}

.nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-button.active,
.nav-button:hover {
  background: #1b3b62;
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.user-picker {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

#loggedUser {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label {
  color: #48586a;
  font-weight: 650;
}

.help-tip {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-left: 4px;
  border: 1px solid #b8c7dc;
  border-radius: 50%;
  background: #f8fbff;
  color: #406080;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  vertical-align: middle;
}

.help-tip:hover,
.help-tip:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 12px 13px;
  min-height: 48px;
}

textarea {
  resize: vertical;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1040px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.meeting-compose {
  position: fixed;
  inset: 5vh max(22px, calc((100vw - 1180px) / 2));
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(13, 23, 38, 0.42);
  backdrop-filter: blur(2px);
}

.meeting-compose-head,
.meeting-meta,
.meeting-compose-footer {
  grid-column: 1 / -1;
}

.meeting-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.meeting-compose-head h2,
.meeting-compose-main h3 {
  margin: 0;
}

.meeting-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meeting-compose-main,
.meeting-compose-side {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.meeting-compose-side {
  background: #f8fbff;
}

.meeting-compose-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.meeting-compose-footer #meetingMessage {
  margin: 0;
}

.meeting-save-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}

.meeting-save-summary span {
  color: var(--muted);
  font-size: 13px;
}

.meeting-save-summary strong {
  font-size: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.wide {
  grid-column: 1 / -1;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.summary-panel div,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 16px;
}

.summary-panel span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-panel strong,
.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

#validationMessage,
#purchaseMessage,
#expenseMessage,
#meetingMessage,
#meetingNoteMessage,
.admin-message {
  grid-column: 1 / -1;
  color: #9f2d2d;
  font-weight: 700;
  line-height: 1.45;
}

#validationMessage.ok,
#purchaseMessage.ok,
#expenseMessage.ok,
#meetingMessage.ok,
#meetingNoteMessage.ok,
.admin-message.ok {
  color: var(--green);
}

.admin-message {
  min-height: 20px;
  margin: 0 0 12px;
}

.actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading button {
  flex: 0 0 auto;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.check-grid label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  min-height: 48px;
}

.check-grid input {
  width: auto;
}

.compact-actions {
  justify-content: flex-start;
  margin-bottom: 2px;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.meeting-compose-side .staff-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-check {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 7px 8px;
  min-height: 34px;
  font-size: 13px;
}

.staff-check input {
  width: auto;
  margin: 0;
}

.staff-check strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.staff-check span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.compact-attendees {
  gap: 6px;
}

.meeting-history {
  margin-top: 18px;
}

.section-heading + .table-wrap,
.section-heading + .calendar-grid {
  margin-top: 0;
}

.admin-focus {
  margin-top: 8px;
}

.admin-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-section summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

.admin-section > .section-heading,
.admin-section > .table-wrap,
.admin-section > form {
  margin-right: 16px;
  margin-left: 16px;
}

.admin-section > .table-wrap,
.admin-section > form {
  margin-bottom: 16px;
}

.admin-employee-overview {
  margin-bottom: 18px;
}

.admin-edit-panel {
  max-width: none;
  margin-bottom: 18px;
}

.employee-form {
  max-width: none;
  margin-bottom: 18px;
}

.hidden {
  display: none !important;
}

.import-panel {
  display: grid;
  gap: 14px;
  max-width: 1040px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.import-panel h2 {
  margin-bottom: 4px;
}

.import-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.import-actions {
  align-items: end;
}

#importMessage {
  min-height: 20px;
  color: #9f2d2d;
  font-weight: 700;
}

#importMessage.ok {
  color: var(--green);
}

.legacy-score {
  display: none;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 11px 16px;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.48;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 750;
}

.primary:active,
.secondary:active,
.nav-button:active {
  transform: translateY(1px);
}

.secondary {
  background: #ffffff;
  color: var(--text);
}

.purchase-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.purchase-panel .section-heading {
  margin-bottom: 0;
}

.purchase-panel .section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-metrics {
  margin-bottom: 18px;
}

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

.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.dashboard-panel .section-heading {
  margin-top: 0;
}

.dashboard-wide {
  grid-column: 1 / -1;
}

.manual-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.manual-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.manual-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.manual-list li {
  padding-left: 4px;
}

.manual-list strong,
.manual-list span {
  display: block;
}

.manual-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 3px;
}

.meeting-board,
.meeting-notes-board {
  margin-top: 22px;
}

.meeting-board {
  margin-top: 0;
}

.board-heading {
  margin-top: 0;
}

.meeting-note-list {
  display: grid;
  gap: 12px;
}

.meeting-note-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 16px;
}

.meeting-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meeting-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1f5f9d;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
}

.meeting-visibility {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
}

.meeting-note-card span:not(.meeting-badge):not(.meeting-visibility) {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.meeting-note-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.meeting-note-card p {
  margin: 0;
  color: #405066;
  line-height: 1.6;
  white-space: pre-wrap;
}

.meeting-note-card details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.meeting-note-card summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.meeting-note-card footer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meeting-history-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.meeting-history-panel > summary {
  cursor: pointer;
  font-weight: 750;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.status-summary button {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.status-summary button.active,
.status-summary button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.status-summary span,
.mini-list-item span,
.empty-note {
  color: var(--muted);
  font-size: 13px;
}

.status-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.today-status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.today-status-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.today-status-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.mini-list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-list-item strong,
.mini-list-item span {
  display: block;
}

.empty-note {
  margin: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #eef4fb;
  color: #405066;
  font-size: 13px;
}

td input,
td select {
  min-height: 40px;
  padding: 8px 10px;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 750;
}

.pill.pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.approved {
  background: var(--green-soft);
  color: var(--green);
}

.pill.rejected {
  background: var(--red-soft);
  color: var(--red);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  padding: 7px 10px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
}

.holiday-list {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.holiday-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.holiday-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.calendar-toolbar {
  align-items: center;
  flex-wrap: wrap;
}

.calendar-controls {
  display: flex;
  flex: 1 1 520px;
  align-items: center;
  gap: 8px;
}

.calendar-controls strong {
  min-width: 116px;
  text-align: center;
  font-size: 18px;
}

.calendar-controls button {
  min-width: auto;
  white-space: nowrap;
}

.calendar-cell {
  position: relative;
  min-height: 118px;
  background: #ffffff;
  padding: 8px;
}

.calendar-cell.today {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: #f8fbff;
}

.calendar-cell.muted {
  background: #f2f5f8;
  color: #98a5b3;
}

.calendar-cell.muted.today {
  background: #eef5ff;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  color: #435368;
  font-weight: 800;
}

.calendar-day em {
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  padding: 2px 6px;
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.calendar-item {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  border-radius: 6px;
  background: #edf6ff;
  color: #183c67;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.calendar-item.leave {
  background: #fff0f0;
  color: #8f2d2d;
}

.calendar-item.trip {
  background: #eef9f2;
  color: #17603f;
}

.calendar-item.meeting {
  background: #fff7df;
  color: #805614;
}

.calendar-item.external {
  background: #edf2ff;
  color: #304c9a;
}

.calendar-item.external-general {
  background: #eef6ff;
  color: #22577a;
}

.calendar-item.external-broadcast {
  background: #f2f0ff;
  color: #4d3c99;
}

.calendar-item.external-reporting {
  background: #eaf8f0;
  color: #1f6b45;
}

.calendar-item.absence {
  background: #f0edff;
  color: #4c2b8f;
}

.print-area {
  display: none;
}

@media (max-width: 860px) {
  :root {
    --mobile-nav-height: 76px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    padding: 7px 8px;
    padding-bottom: calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar .brand {
    display: none;
  }

  .nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    display: grid;
    flex: 0 0 58px;
    min-height: 48px;
    place-items: center;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    padding: 7px 5px;
    white-space: normal;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar p {
    display: none;
  }

  .user-picker {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    gap: 8px;
  }

  .user-picker label {
    display: none;
  }

  #loggedUser {
    grid-column: 1 / -1;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-picker select,
  .user-picker button {
    min-height: 40px;
    padding: 8px 10px;
  }

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

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid > .actions.wide {
    position: sticky;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    z-index: 10;
    margin: 0 -4px -4px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 12px 4px 4px;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .form-grid,
  .meeting-compose,
  .meeting-meta,
  .meeting-compose-footer,
  .import-grid,
  .summary-panel,
  .split,
  .staff-grid,
  .dashboard-grid,
  .manual-layout,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

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

  .today-status-list {
    grid-template-columns: 1fr;
  }

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

  .meeting-compose {
    inset: 10px;
    grid-template-rows: auto auto auto auto;
    padding: 14px;
    border-radius: 10px;
  }

  .meeting-compose-head,
  .meeting-compose-footer {
    align-items: stretch;
  }

  .meeting-compose-footer {
    position: sticky;
    bottom: -14px;
    z-index: 2;
    margin: 0 -14px -14px;
    background: rgba(255, 255, 255, 0.98);
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .calendar-cell {
    min-height: 62px;
    padding: 6px;
  }

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

  .calendar-toolbar,
  .calendar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .calendar-toolbar {
    align-items: stretch;
  }

  .calendar-controls {
    grid-column: 1 / -1;
  }

  .calendar-controls strong {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    padding: 10px 0 4px;
  }

  .calendar-toolbar > select,
  .calendar-toolbar > button {
    width: 100%;
  }

  .summary-panel {
    gap: 10px;
  }

  .metric,
  .summary-panel div {
    padding: 12px;
  }

  .metric strong {
    font-size: 26px;
  }

  .calendar-day {
    gap: 2px;
    font-size: 12px;
    margin-bottom: 4px;
  }

  .calendar-day em {
    padding: 1px 5px;
    font-size: 9px;
  }

  .calendar-item {
    border-radius: 5px;
    padding: 2px 4px;
    font-size: 9px;
    line-height: 1.2;
  }

  .login-gate {
    align-items: start;
    overflow-x: hidden;
    padding: 18px;
    padding-top: 72px;
  }

  .login-card {
    width: 100%;
    max-width: calc(100vw - 36px);
    padding: 22px;
  }

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

@media (max-width: 640px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 12px;
  }

  td {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    border-bottom: 0;
    padding: 0;
    text-align: left;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: "";
    display: none;
  }
}

@media print {
  @page {
    margin: 14mm;
    size: A4;
  }

  body {
    background: #ffffff;
    color: #111827;
  }

  body.printing-report .login-gate,
  body.printing-report .app-shell {
    display: none;
  }

  body.printing-report .print-area {
    display: block;
  }

  .print-document {
    font-size: 11px;
    line-height: 1.45;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 2px solid #1d2733;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .print-header strong {
    display: block;
    color: #2563eb;
    font-size: 12px;
    margin-bottom: 5px;
  }

  .print-header h1 {
    font-size: 22px;
    margin: 0 0 5px;
  }

  .print-header p {
    color: #4b5563;
  }

  .print-header dl {
    min-width: 190px;
    margin: 0;
  }

  .print-header dl div {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 8px;
    margin-bottom: 5px;
  }

  .print-header dt {
    color: #6b7280;
    font-weight: 700;
  }

  .print-header dd {
    margin: 0;
    text-align: right;
  }

  .print-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }

  .print-summary div {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 8px;
  }

  .print-summary span {
    display: block;
    color: #6b7280;
    font-size: 10px;
    margin-bottom: 3px;
  }

  .print-summary strong {
    font-size: 13px;
  }

  .print-section {
    break-inside: avoid;
    margin-bottom: 18px;
  }

  .print-section h2 {
    font-size: 14px;
    margin: 0 0 8px;
  }

  .print-section table {
    display: table;
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }

  .print-section thead {
    display: table-header-group;
  }

  .print-section tbody {
    display: table-row-group;
  }

  .print-section tr {
    display: table-row;
    box-shadow: none;
    padding: 0;
  }

  .print-section th,
  .print-section td {
    display: table-cell;
    border: 1px solid #d1d5db;
    padding: 6px 7px;
    vertical-align: top;
  }

  .print-section td::before {
    content: "";
    display: none;
  }

  .print-section th {
    background: #eef2f7;
    color: #111827;
    font-size: 10px;
  }

  .print-footer {
    border-top: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 10px;
    margin-top: 20px;
    padding-top: 8px;
  }

  .legacy-score {
    display: none;
  }
}
