:root {
  --bg: #f3f6f7;
  --panel: #ffffff;
  --line: #d7e0e4;
  --text: #172a33;
  --muted: #60727b;
  --accent: #0e6071;
  --accent-strong: #084b5a;
  --accent-soft: #e4f3f6;
  --warm-soft: #f6d19b;
  --success-soft: #e3f3e9;
  --danger-soft: #f8e3df;
  --warn-soft: #fff1d6;
  --shadow: 0 10px 26px rgba(24, 48, 58, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f4f4f4;
  color: #222;
  font-family: "Microsoft YaHei", "PingFang SC", "SimSun", sans-serif;
}

body {
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(15, 96, 113, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 96, 113, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg) 0%, #f7faf9 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

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

button {
  cursor: pointer;
}

.page {
  width: min(1840px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.top-stage,
.content-stage {
  display: grid;
  gap: 16px;
}

.sheet-box,
.plain-box,
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.sheet-box {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.sheet-table {
  width: 100%;
  min-width: 1850px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  color: #1f2f3f;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid #aeb6be;
  padding: 10px 8px;
  vertical-align: top;
}

.sheet-table tr.schedule-row-flash > th,
.sheet-table tr.schedule-row-flash > td {
  animation: schedule-row-flash 2.2s ease;
}

.sheet-table th.date-col,
.sheet-table td.date-col {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #ffffff;
}

.sheet-table th.weekday-col,
.sheet-table td.weekday-col {
  position: sticky;
  left: 78px;
  z-index: 4;
  background: #ffffff;
}

.sheet-table .weekday-col.weekend {
  background: #fff200;
}

.sheet-table tr > .date-col,
.sheet-table tr > .weekday-col {
  box-shadow: 1px 0 0 rgba(174, 182, 190, 0.85);
}

.sheet-title th {
  padding: 10px 8px;
  background: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.sheet-header th,
.sheet-members th,
.sheet-members td {
  background: #d8d8d8;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
}

.sheet-members td {
  font-weight: 400;
  line-height: 1.8;
}

.date-col {
  width: 78px;
  text-align: center;
  background: #fff;
  font-weight: 700;
  line-height: 1.5;
}

.weekday-col {
  width: 34px;
  text-align: center;
  vertical-align: middle !important;
  padding: 10px 2px !important;
  background: #ffffff;
}

.weekday-col.weekend {
  background: #fff200;
  font-weight: 700;
}

.group-col {
  width: 190px;
}

.long-col {
  width: 132px;
}

.adjust-col {
  width: 245px;
}

.rest-col,
.leave-col,
.note-col {
  width: 118px;
}

.duty-cell {
  line-height: 1.8;
}

.duty-cell.active {
  background: #ffd1a0;
}

.duty-cell.rest {
  background: #ffffff;
  text-align: center;
  color: #4c6177;
}

.duty-inline {
  word-break: break-all;
  line-height: 1.8;
}

.shift-prefix {
  color: #203a53;
  font-weight: 700;
  margin-right: 0;
}

.name-list,
.side-list {
  word-break: break-all;
  line-height: 1.8;
}

.person {
  white-space: nowrap;
}

.person.leader {
  font-weight: 800;
}

.person.relief {
  color: #c62828;
  font-weight: 800;
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(198, 40, 40, 0.1);
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

.blank-cell {
  display: block;
  min-height: 20px;
}

@keyframes schedule-row-flash {
  0% {
    box-shadow: inset 0 0 0 999px rgba(14, 96, 113, 0.24);
  }

  100% {
    box-shadow: inset 0 0 0 999px rgba(14, 96, 113, 0);
  }
}

.utility-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.95fr);
  gap: 14px;
  font-size: 13px;
}

.utility-block {
  display: grid;
  gap: 10px;
  align-content: start;
}

.utility-block-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.utility-block-actions {
  justify-items: end;
}

.utility-left,
.utility-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.utility-text,
.utility-stat {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(19, 91, 111, 0.06);
  color: var(--text);
  font-size: 12px;
}

.utility-stat {
  background: rgba(203, 123, 59, 0.12);
  color: #7c481d;
  font-weight: 700;
}

.status-chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #b9c0c7;
  background: #f0f2f4;
  font-size: 12px;
}

.btn {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #b8c7ce;
  border-radius: 8px;
  background: #f8fafb;
  color: #243943;
  font-weight: 700;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.btn:hover {
  border-color: #7da6b1;
  background: #eef7f9;
}

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

.btn.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

.btn.warn {
  border-color: #d69a38;
  background: #fff1d6;
  color: #7a5013;
}

.btn.danger {
  border-color: #df8b7e;
  background: #f8e3df;
  color: #9d2d22;
}

.btn.mini {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
}

.cell-edit-row {
  margin-top: 8px;
}

.day-ledger-box {
  border-color: rgba(19, 91, 111, 0.24);
}

.ledger-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 35, 44, 0.42);
  backdrop-filter: blur(4px);
}

.ledger-modal {
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 91, 111, 0.18);
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(15, 37, 47, 0.22);
  padding: 22px;
}

.ledger-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.ledger-modal-head h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  color: var(--text);
}

.ledger-modal-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.workbench {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.plain-box {
  padding: 16px;
}

.plain-box h2 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
}

.subtle {
  color: #67788a;
  font-size: 12px;
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 180px;
  font-size: 12px;
  color: #5f6f80;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #b9c0c7;
  background: #fff;
  color: #233445;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

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

.simple-card {
  border: 1px solid #c5ccd3;
  background: #fafbfc;
  padding: 10px;
}

.grouped-user-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.stack-layout {
  display: grid;
  gap: 12px;
}

.user-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.user-stat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 91, 111, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.user-stat-pill.strong {
  background: rgba(19, 91, 111, 0.16);
  color: var(--accent);
}

.user-stat-pill.warn {
  background: rgba(198, 40, 40, 0.1);
  color: #b42318;
}

.group-panel {
  overflow: hidden;
  border: 1px solid rgba(145, 167, 161, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.group-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(145, 167, 161, 0.18);
  background: linear-gradient(180deg, rgba(237, 245, 244, 0.92), rgba(255, 255, 255, 0.96));
}

.group-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.group-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 91, 111, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.simple-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.simple-card p {
  margin: 6px 0;
}

.event-fold-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.event-group-card {
  overflow: hidden;
  border: 1px solid rgba(145, 167, 161, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.event-group-card summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(245, 249, 250, 0.96), rgba(255, 255, 255, 0.96));
}

.event-group-card summary::-webkit-details-marker {
  display: none;
}

.event-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-group-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.event-group-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(145, 167, 161, 0.16);
}

.request-warning-box {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  background: rgba(248, 236, 205, 0.72);
  color: #8a5a12;
  font-size: 12px;
}

.request-warning-box p {
  margin: 4px 0;
}

.ai-chat-shell {
  padding: 0;
  overflow: hidden;
}

.ai-chat-head {
  padding: 16px 18px 0;
}

.ai-chat-subtle {
  padding: 0 18px 12px;
}

.ai-inline-notice {
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid #c5ccd3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.ai-inline-notice.success {
  border-color: rgba(55, 139, 85, 0.28);
  background: rgba(220, 238, 229, 0.78);
  color: #24633b;
}

.ai-inline-notice.warn {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(248, 236, 205, 0.86);
  color: #8a5a12;
}

.ai-inline-notice.danger {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(247, 224, 219, 0.84);
  color: #a2281d;
}

.ai-chat-thread {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(180deg, #f8fbfc, #ffffff);
  border-top: 1px solid rgba(145, 167, 161, 0.18);
  border-bottom: 1px solid rgba(145, 167, 161, 0.18);
}

.ai-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ai-message.user {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.ai-message-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(145, 167, 161, 0.24);
  background: rgba(19, 91, 111, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(25, 58, 67, 0.08);
}

.ai-message.user .ai-message-avatar {
  grid-column: 2;
  background: rgba(19, 91, 111, 0.18);
}

.ai-message-bubble {
  max-width: min(100%, 940px);
  padding: 14px 16px;
  border: 1px solid rgba(145, 167, 161, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 26px rgba(25, 58, 67, 0.08);
}

.ai-message.user .ai-message-bubble {
  grid-column: 1;
  justify-self: end;
  border-color: rgba(19, 91, 111, 0.18);
  background: linear-gradient(135deg, #1d5b73, #14485c);
  color: #fff;
}

.ai-message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-message-title {
  font-size: 14px;
  font-weight: 800;
}

.ai-message-meta {
  color: #6c7e88;
  font-size: 12px;
}

.ai-message.user .ai-message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.ai-message-content {
  line-height: 1.8;
  font-size: 14px;
  color: #20323d;
}

.ai-message.user .ai-message-content {
  color: #fff;
}

.ai-message-section {
  margin-top: 12px;
}

.ai-thinking {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-thinking-label {
  font-weight: 700;
}

.ai-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(19, 91, 111, 0.6);
  animation: aiPulse 1.25s infinite ease-in-out;
}

.ai-thinking-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-thinking-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes aiPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.ai-preview-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #c7d0d8;
}

.ai-prompt-input {
  min-height: 120px;
}

.ai-response-box {
  min-height: 220px;
  font-family: "Consolas", "Courier New", monospace;
  white-space: pre-wrap;
}

.ai-operation-preview {
  margin-top: 12px;
  padding: 0;
}

.ai-operation-list {
  margin-top: 8px;
}

.ai-operation-card {
  background: rgba(250, 251, 252, 0.92);
}

.ai-operation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.ai-edit-form {
  margin-top: 10px;
}

.ai-edit-table td input,
.ai-edit-table td select,
.ai-edit-table td textarea {
  width: 100%;
}

.ai-op-textarea {
  min-height: 72px;
  resize: vertical;
}

.ai-chat-composer {
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.ai-composer-box {
  border: 1px solid rgba(145, 167, 161, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 26px rgba(25, 58, 67, 0.08);
  padding: 14px 16px 16px;
}

.ai-composer-pills {
  margin-top: 0;
  margin-bottom: 10px;
}

.ai-chat-input-field {
  color: var(--text);
}

.ai-chat-input {
  min-height: 132px;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.8;
  background: rgba(247, 250, 251, 0.96);
}

.ai-config-card {
  margin-top: 12px;
  border: 1px solid rgba(145, 167, 161, 0.22);
  border-radius: 18px;
  background: rgba(246, 250, 251, 0.9);
  overflow: hidden;
}

.ai-config-card summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #21465b;
}

.ai-config-body {
  padding: 0 14px 14px;
}

.ai-send-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.ai-send-hint {
  flex: 1 1 260px;
}

.ai-send-actions {
  justify-content: flex-end;
}

.ai-preview-table-box {
  margin-top: 8px;
}

.ai-raw-details {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed #c7d0d8;
  background: rgba(255, 255, 255, 0.86);
}

.ai-raw-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #1f4f73;
}

.request-status {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #c5ccd3;
  background: #fff;
  font-size: 12px;
}

.table-box {
  overflow: auto;
  border: 1px solid #c5ccd3;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.simple-table th,
.simple-table td {
  border: 1px solid #d4d8dd;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.simple-table th {
  background: #f1f3f5;
}

.editor-banner {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #a9c2d8;
  background: #eef6fc;
  color: #1f4f73;
  font-size: 13px;
  font-weight: 700;
}

.editing-row td {
  background: #eef6fc;
}

.editing-card {
  border-color: #9ebbd4;
  background: #eef6fc;
}

.calendar-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.calendar-cell {
  border: 1px solid #c5ccd3;
  background: #fafbfc;
  padding: 8px;
}

.calendar-date {
  font-weight: 700;
}

.calendar-status {
  margin-top: 6px;
}

.empty-box {
  border: 1px dashed #c0c8d0;
  padding: 14px;
  color: #6e7d8c;
  background: #fbfcfd;
}

.login-wrap {
  min-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
}

.login-box {
  width: min(760px, 100%);
  padding: 24px;
}

.login-box h1 {
  margin: 0 0 10px;
  font-size: 24px;
  text-align: center;
}

.login-tip {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ccd3d9;
  background: #f7f8f9;
  line-height: 1.8;
  font-size: 13px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.login-side,
.login-panel {
  padding: 22px;
  border-radius: 22px;
}

.login-side {
  background:
    linear-gradient(155deg, rgba(255, 252, 247, 0.96), rgba(239, 248, 247, 0.92)),
    linear-gradient(155deg, rgba(19, 91, 111, 0.08), rgba(203, 123, 59, 0.08));
  border: 1px solid rgba(19, 91, 111, 0.12);
}

.login-panel {
  border: 1px solid rgba(145, 167, 161, 0.28);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-list {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.9;
}

.login-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.login-demo {
  margin-top: 18px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfb),
    linear-gradient(90deg, rgba(15, 96, 113, 0.08), rgba(224, 160, 75, 0.08));
  box-shadow: var(--shadow);
}

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

.hero-kicker,
.panel-kicker,
.login-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.hero-copy p,
.panel-head p,
.login-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hero-meta,
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  margin-top: 18px;
}

.hero-chip,
.meta-chip,
.legend-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #d6e1e5;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.hero-chip.strong {
  border-color: rgba(15, 96, 113, 0.18);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.hero-panel {
  padding: 16px;
  border-radius: 8px;
  background: #123a46;
  color: #f5fbfc;
}

.hero-panel-label {
  font-size: 13px;
  opacity: 0.86;
}

.hero-panel-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
}

.hero-panel-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.9;
}

.hero-panel-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hero-panel-stat {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-panel-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.hero-panel-stat-label {
  font-size: 12px;
  opacity: 0.78;
}

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

.summary-card {
  position: relative;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.summary-card::before,
.score-visual-card::before {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.summary-card.success {
  background: #ffffff;
}

.summary-card.warn {
  background: #ffffff;
}

.summary-card.danger {
  background: #ffffff;
}

.summary-card.success::before {
  background: #2d8753;
}

.summary-card.warn::before {
  background: #d99a2a;
}

.summary-card.danger::before {
  background: #c84e3d;
}

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

.summary-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.summary-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.panel-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.schedule-panel {
  padding: 18px;
}

.schedule-desktop {
  display: block;
}

.schedule-mobile {
  display: none;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.shift-badge.compact {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}

.shift-badge.day,
.legend-chip.day,
.mini-status.day,
.mobile-shift-card.day {
  background: var(--warm-soft);
  color: #794214;
}

.shift-badge.middle,
.legend-chip.middle,
.mini-status.middle,
.mobile-shift-card.middle {
  background: var(--accent-soft);
  color: #0f4e61;
}

.shift-badge.night,
.legend-chip.night,
.mini-status.night,
.mobile-shift-card.night {
  background: #e8eef7;
  color: #355271;
}

.shift-badge.rest {
  background: #eef3f5;
  color: #596f78;
}

.duty-stack {
  display: grid;
  gap: 8px;
}

.name-sep {
  color: #7b8d94;
}

.utility-bar {
  margin-top: 0;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(145, 167, 161, 0.45);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.status-chip.success,
.request-status.success {
  background: var(--success-soft);
  color: #2d6c56;
}

.status-chip.warn,
.request-status.warn {
  background: var(--warn-soft);
  color: #9a6a17;
}

.status-chip.danger,
.request-status.danger {
  background: var(--danger-soft);
  color: #a34b42;
}

.status-chip.neutral,
.request-status.neutral {
  background: #eef3f5;
  color: #5c737b;
}

.request-status {
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
}

.calendar-week {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.disclosure-card {
  overflow: hidden;
}

.disclosure-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.disclosure-card summary::-webkit-details-marker {
  display: none;
}

.disclosure-title {
  font-size: 17px;
  font-weight: 800;
}

.disclosure-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.disclosure-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 91, 111, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.disclosure-body {
  padding-top: 12px;
}

.disclosure-card[open] summary {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.disclosure-card .plain-box,
.disclosure-card .panel-card {
  box-shadow: none;
}

.mobile-schedule {
  display: grid;
  gap: 12px;
}

.mobile-day-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(145, 167, 161, 0.28);
  background: rgba(255, 255, 255, 0.95);
}

.mobile-day-card.schedule-row-flash {
  animation: schedule-card-flash 2.2s ease;
}

.mobile-day-head {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(145, 167, 161, 0.18);
}

.mobile-day-date {
  font-size: 20px;
  font-weight: 800;
}

.mobile-day-week {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-day-week.weekend {
  color: #9a6a17;
  font-weight: 700;
}

.mobile-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3f5;
  color: #596f78;
  font-size: 12px;
}

.mobile-shift-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

@keyframes schedule-card-flash {
  0% {
    box-shadow:
      0 0 0 4px rgba(14, 96, 113, 0.2),
      0 14px 30px rgba(14, 96, 113, 0.12);
  }

  100% {
    box-shadow: none;
  }
}

.mobile-shift-card,
.mobile-aux-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(145, 167, 161, 0.2);
}

.mobile-shift-head,
.mobile-aux-title,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-shift-body,
.mobile-aux-body {
  margin-top: 10px;
  line-height: 1.8;
  word-break: break-all;
}

.mobile-aux-card.soft {
  background: #f8fbfa;
}

.mobile-aux-card.warn {
  background: var(--warn-soft);
}

.mobile-aux-card.danger {
  background: var(--danger-soft);
}

.group-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 52, 58, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.ai-date-row {
  margin-top: 0;
  margin-bottom: 10px;
}

.scoreboard-layout {
  display: grid;
  gap: 12px;
}

.score-visual-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-visual-card {
  position: relative;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.score-visual-card.strong {
  background: #ffffff;
}

.score-visual-card.positive {
  background: #ffffff;
}

.score-visual-card.negative {
  background: #ffffff;
}

.score-visual-card.strong::before {
  background: var(--accent);
}

.score-visual-card.positive::before {
  background: #2d8753;
}

.score-visual-card.negative::before {
  background: #c84e3d;
}

.score-visual-label {
  color: var(--muted);
  font-size: 13px;
}

.score-visual-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.score-visual-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.score-rank-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.score-rank-item {
  display: grid;
  gap: 8px;
}

.score-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-rank-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(24, 52, 58, 0.08);
}

.score-rank-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.score-rank-bar.positive {
  background: linear-gradient(90deg, rgba(36, 99, 59, 0.78), rgba(91, 177, 114, 0.96));
}

.score-rank-bar.negative {
  background: linear-gradient(90deg, rgba(180, 35, 24, 0.78), rgba(221, 93, 73, 0.96));
}

.leave-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}

.leave-visual-card {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.leave-visual-title {
  font-weight: 800;
}

.leave-visual-type {
  margin-top: 8px;
  color: #9a4f28;
  font-size: 13px;
  font-weight: 700;
}

.leave-visual-date {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.scoreboard-table-box {
  max-height: 420px;
  overflow: auto;
}

.import-upload-shell {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dce6ea;
  border-radius: 8px;
  background: #f8fbfc;
}

.import-file-field {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #9db8c1;
  border-radius: 8px;
  background: #ffffff;
}

.import-file-title {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.import-file-input {
  width: 100%;
}

.import-status-grid,
.import-preview-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.import-wizard-box {
  display: grid;
  gap: 14px;
}

.import-current-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.import-current-card {
  padding: 12px 14px;
  border: 1px solid #dbe5e8;
  border-radius: 8px;
  background: #f8fbfb;
}

.import-current-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.import-current-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-status-card,
.import-preview-shell,
.import-preview-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.import-status-card {
  padding: 14px;
  border-left: 4px solid #9db8c1;
}

.import-status-head,
.import-preview-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.import-status-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.import-status-body {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.import-status-body p,
.import-preview-day-body p {
  margin: 6px 0 0;
}

.import-warning-box,
.import-inline-warning {
  margin-top: 10px;
}

.import-preview-shell {
  margin-top: 14px;
  padding: 16px;
  background: #fbfdfd;
}

.import-step-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.import-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #dce6ea;
  border-radius: 8px;
  background: #ffffff;
  color: #70838b;
  font-size: 13px;
}

.import-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf3f5;
  color: #586f77;
  font-size: 12px;
  font-weight: 800;
}

.import-step strong {
  font-size: 13px;
  line-height: 1.2;
}

.import-step.active {
  border-color: rgba(15, 96, 113, 0.22);
  background: var(--accent-soft);
  color: var(--accent);
}

.import-step.active span,
.import-step.current span {
  background: var(--accent);
  color: #ffffff;
}

.import-step.current {
  border-color: rgba(15, 96, 113, 0.22);
  background: var(--accent-soft);
  color: var(--accent);
}

.import-step.completed {
  border-color: rgba(24, 117, 77, 0.18);
  background: #f3faf6;
  color: #1f6e4f;
}

.import-step.completed span {
  background: #1f6e4f;
  color: #ffffff;
}

.import-stage {
  border: 1px solid #dce6ea;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.import-stage.current {
  border-color: rgba(15, 96, 113, 0.22);
  box-shadow: 0 8px 20px rgba(15, 96, 113, 0.06);
}

.import-stage.completed {
  border-color: rgba(24, 117, 77, 0.14);
  background: #fbfdfc;
}

.import-stage.disabled {
  background: #f8fbfb;
}

.import-stage-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e4ecef;
}

.import-stage-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #edf3f5;
  color: #536971;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.import-stage.current .import-stage-index {
  background: var(--accent);
  color: #ffffff;
}

.import-stage.completed .import-stage-index {
  background: #1f6e4f;
  color: #ffffff;
}

.import-stage-copy h3 {
  margin: 0;
  font-size: 16px;
}

.import-stage-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-stage-summary {
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-stage-summary strong {
  color: var(--text);
}

.import-stage-body {
  padding: 14px 16px 16px;
}

.import-stage-placeholder {
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-stage-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.import-range-row {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dce6ea;
  border-radius: 8px;
  background: #ffffff;
}

.import-preview-actions {
  margin-top: 8px;
}

.import-preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.import-preview-day {
  padding: 0;
  overflow: hidden;
}

.import-preview-day-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e4ecef;
  background: #f5f8f9;
}

.import-preview-day-head strong {
  font-size: 18px;
  line-height: 1.2;
  color: var(--text);
}

.import-preview-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 14px 0;
}

.import-preview-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(145, 167, 161, 0.18);
  background: #eef3f5;
  color: #596f78;
  font-size: 12px;
  font-weight: 700;
}

.import-preview-pill.day {
  border-color: #e7b56f;
  background: #f6d19b;
  color: #7b4318;
}

.import-preview-pill.middle {
  border-color: #a7d5df;
  background: var(--accent-soft);
  color: #0f4e61;
}

.import-preview-pill.night {
  border-color: #c3d5eb;
  background: #e8eef7;
  color: #355271;
}

.import-preview-pill.rest {
  background: #fff;
  color: #596f78;
}

.import-preview-day-body {
  margin-top: 12px;
  padding: 12px 14px 14px;
  border-top: 1px dashed #d3dde1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.import-meta-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(19, 91, 111, 0.12);
  border-radius: 14px;
  background: rgba(246, 250, 251, 0.92);
}

.import-meta-box p {
  margin: 6px 0;
  line-height: 1.7;
}

.score-positive {
  color: #1d7a46;
  font-weight: 800;
}

.score-negative {
  color: #b42318;
  font-weight: 800;
}

.score-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(24, 52, 58, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .hero-card,
  .summary-grid,
  .score-visual-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .legend-row.subtle-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .utility-bar {
    grid-template-columns: 1fr;
  }

  .utility-block-actions {
    justify-items: stretch;
  }

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

@media (max-width: 820px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .login-grid {
    grid-template-columns: 1fr;
  }

  .utility-bar {
    grid-template-columns: 1fr;
  }

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

  .hero-card {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 18px;
  }

  .hero-copy h1,
  .login-box h1 {
    font-size: 26px;
  }

  .schedule-desktop {
    display: block;
  }

  .schedule-mobile {
    display: none;
  }

  .sheet-box {
    border-radius: 18px;
  }

  .sheet-table {
    min-width: 1480px;
    font-size: 12px;
  }

  .sheet-table th,
  .sheet-table td {
    padding: 8px 6px;
  }

  .sheet-title th {
    font-size: 16px;
  }

  .group-col {
    width: 178px;
  }

  .long-col {
    width: 122px;
  }

  .adjust-col {
    width: 220px;
  }

  .action-row .btn,
  .utility-right .btn {
    flex: 1 1 calc(50% - 5px);
  }

  .ai-chat-thread,
  .ai-chat-composer {
    padding: 14px;
  }

  .ai-message,
  .ai-message.user {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ai-message.user .ai-message-avatar,
  .ai-message.user .ai-message-bubble {
    grid-column: auto;
  }

  .ai-message-bubble,
  .ai-message.user .ai-message-bubble {
    justify-self: stretch;
    max-width: 100%;
  }

  .ai-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 12px;
  }

  .ai-send-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-send-actions {
    justify-content: stretch;
  }

  body {
    padding: 10px;
  }
}

@media (max-width: 560px) {
  .summary-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .action-row .btn,
  .utility-right .btn {
    flex: 1 1 100%;
  }

  .group-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ai-chat-head,
  .ai-chat-subtle,
  .ai-inline-notice,
  .ai-chat-thread,
  .ai-chat-composer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ai-composer-box {
    padding: 12px;
    border-radius: 18px;
  }

  .sheet-table {
    min-width: 1340px;
    font-size: 11px;
  }

  .sheet-table th,
  .sheet-table td {
    padding: 7px 5px;
  }

  .sheet-title th {
    font-size: 15px;
  }

  .date-col {
    width: 70px;
  }

  .weekday-col {
    width: 30px;
  }

  .sheet-table th.weekday-col,
  .sheet-table td.weekday-col {
    left: 70px;
  }

  .ledger-modal-backdrop {
    padding: 12px;
  }

  .ledger-modal {
    max-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 18px;
  }

  .ledger-modal-head {
    flex-direction: column;
  }

  .ledger-modal-head h2 {
    font-size: 18px;
  }

  .import-step-row,
  .import-current-strip {
    grid-template-columns: 1fr;
  }

  .import-stage-head {
    padding: 12px;
  }

  .import-stage-body,
  .import-stage-placeholder,
  .import-stage-summary {
    padding-left: 12px;
    padding-right: 12px;
  }
}
