:root {
  --shell-surface: #ffffff;
  --shell-border: #dde1e7;
  --shell-muted: #667085;
  --shell-ink: #202630;
  --shell-active: #4f46e5;
  --shell-active-soft: #e8eeff;
}

.platform-app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}

.platform-app-shell--without-header {
  grid-template-rows: minmax(0, 1fr) auto;
}

.platform-app-shell > main {
  min-width: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.platform-shell-header {
  position: sticky;
  top: 0;
  z-index: 30;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 5px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  background: var(--shell-surface);
  border-bottom: 1px solid var(--shell-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.platform-shell-header__main,
.platform-shell-actions,
.platform-shell-tabs-rail,
.platform-shell-tabs {
  display: flex;
  align-items: center;
  min-width: 0;
}

.platform-shell-header__main {
  /* basis 0: 탭  Intrinsic 폭이 헤더·페이지 가로를 키우지 않게 한다. */
  flex: 1 1 0%;
  gap: 10px;
  overflow: hidden;
}

.platform-shell-tabs-rail {
  flex: 1 1 0%;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.platform-shell-tabs-nav {
  appearance: none;
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 24px;
  min-height: 24px;
  padding: 0 4px;
  border: 1px solid #c9d3e6;
  border-radius: 999px;
  background: #f7f9fe;
  color: #33405b;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.platform-shell-tabs-rail.is-scrollable .platform-shell-tabs-nav {
  display: inline-flex;
}

.platform-shell-tabs-nav:hover:not(:disabled) {
  background: #edf2ff;
}

.platform-shell-tabs-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.platform-shell-tabs {
  flex: 1 1 0%;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.platform-shell-tabs::-webkit-scrollbar {
  display: none;
}

.platform-shell-tabs-rail.is-scrollable .platform-shell-tabs {
  cursor: grab;
  touch-action: none;
}

.platform-shell-tabs.is-tabs-panning {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.platform-shell-tabs.is-tabs-panning a {
  pointer-events: none;
}

.platform-shell-tab,
.platform-shell-control {
  appearance: none;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9d3e6;
  border-radius: 999px;
  background: #f7f9fe;
  color: #33405b;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.platform-shell-tab {
  -webkit-user-drag: none;
  user-select: none;
}

.platform-shell-tab:hover,
.platform-shell-control:hover {
  background: #edf2ff;
}

.platform-shell-tab.is-active {
  background: var(--shell-active-soft);
  border-color: #8aa0df;
  color: #1f3269;
}

.platform-shell-utility-menu {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
}

.platform-shell-utility-menu::after {
  position: absolute;
  top: 50%;
  right: 8px;
  color: #52617c;
  content: "▾";
  font-size: 0.66rem;
  pointer-events: none;
  transform: translateY(-52%);
}

.platform-shell-utility-menu select {
  appearance: none;
  width: 5.2rem;
  min-width: 5.2rem;
  max-width: 5.2rem;
  height: 24px;
  min-height: 24px;
  box-sizing: border-box;
  padding: 2px 23px 2px 9px;
  border: 1px solid #c9d3e6;
  border-radius: 999px;
  background: #f7f9fe;
  color: #33405b;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.platform-shell-utility-menu.is-active select,
.platform-shell-utility-menu select:hover {
  border-color: #8aa0df;
  background: var(--shell-active-soft);
  color: #1f3269;
}

.platform-shell-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  gap: 8px;
}

.platform-shell-actions form {
  margin: 0;
}

.platform-shell-language select {
  width: auto;
  min-width: 5rem;
  height: 24px;
  min-height: 24px;
  box-sizing: border-box;
  padding: 2px 6px;
  border-color: var(--shell-border);
  background: #ffffff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.platform-shell-user {
  color: #3e4a64;
  font-size: 0.84rem;
  font-weight: 600;
}

.platform-shell-login-name {
  max-width: 10rem;
  overflow: hidden;
  color: #24324a;
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-meta {
  min-width: 34px;
  min-height: 24px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd3df;
  border-radius: 999px;
  background: #f3f5f8;
  color: #455064;
  font-size: 0.78rem;
  font-weight: 700;
}

.section-meta--active {
  min-height: 28px;
  padding: 3px 10px;
  border-color: #1b6b3a;
  background: #1f7a3f;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px rgb(31 122 63 / 18%);
}

.platform-page,
.table-maker-layout {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.platform-page {
  display: grid;
  align-content: start;
  gap: 14px;
}

.platform-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-width: 0;
  align-self: start;
}

.platform-page-heading > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.platform-page-heading h1,
.platform-page-heading p {
  margin: 0;
}

.platform-page-heading h1 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.platform-page-heading p {
  color: var(--shell-muted);
  line-height: 1.2;
}

.platform-page-heading > a,
.platform-page-heading__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--shell-border, #cbd5e1);
  border-radius: 6px;
  background: var(--shell-surface, #ffffff);
  color: var(--shell-text, #334155);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.platform-page-heading > a:hover,
.platform-page-heading__back:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.platform-section {
  min-width: 0;
  padding: 15px 17px;
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 6px;
}

.platform-section h1,
.platform-section h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.platform-shell-footer {
  width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--shell-border);
  background: #eef1f4;
  color: var(--shell-muted);
  font-size: 0.78rem;
}

.platform-settings-page {
  min-height: calc(100vh - 74px);
}

.platform-settings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.platform-settings-head h1 {
  margin: 0 0 0.35rem;
}

.platform-settings-head .hint {
  margin: 0;
}

.platform-settings-form {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.platform-settings-form label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.platform-settings-form select {
  width: auto;
  padding: 0.3rem 0.45rem;
  font: inherit;
}

.personal-signature-section {
  margin-top: 1.5rem;
}

.personal-signature-section > h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.personal-signature-notice {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d5dce6;
  border-radius: 6px;
  background: #f8fafc;
  display: grid;
  gap: 0.45rem;
}

.personal-signature-notice p {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.personal-signature-notice p::before {
  content: "•";
  color: #94a3b8;
  flex: 0 0 auto;
}

.personal-signature-notice__strong {
  color: #334155 !important;
  font-weight: 600;
}

.personal-signature-notice--tryout {
  border-left: 3px solid #8a6d3b;
  background: #fff8e8;
}

.personal-signature-pad {
  margin: 0;
  max-width: 600px;
}

.personal-signature-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-start;
  margin: 0.75rem 0;
}

.personal-signature-layout__pad {
  flex: 1 1 620px;
  min-width: 0;
}

.personal-signature-layout__preview {
  flex: 1 1 280px;
  min-width: 0;
}

.personal-signature-area-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
}


.personal-signature-pad canvas {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 3 / 1;
  border: 1px solid #cfd6e4;
  border-radius: 4px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.personal-signature-preview-wrap {
  margin: 0;
}

.personal-signature-preview {
  display: block;
  max-width: 600px;
  width: 100%;
  height: auto;
  border: 1px solid #e7eaf0;
  background: #fff;
}

.personal-signature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
}

.personal-signature-actions button {
  min-height: 34px;
  box-sizing: border-box;
}

.personal-signature-delete-form {
  display: inline;
  margin: 0;
}

.personal-signature-flash {
  color: #1d4ed8;
}

/* 학교 설정 껍데기: 왼쪽 조작, 오른쪽 설명. 저장은 후속. */
.school-settings-shell {
  margin-top: 1.25rem;
}

.school-settings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.school-settings-head > div {
  min-width: 0;
}

.school-settings-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.school-settings-head .hint {
  margin: 0;
}

.school-settings-head .school-settings-caution {
  margin-top: 0.45rem;
  color: #9f1d1d;
}

.school-settings-result {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
}

.school-settings-result.is-ok {
  background: #e8f7ef;
  color: #08633a;
}

.school-settings-result.is-error {
  background: #fff0f0;
  color: #9f1d1d;
}

.school-settings-form {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.school-settings-row {
  display: grid;
  grid-template-columns: minmax(16rem, 0.42fr) minmax(0, 1fr);
  gap: 0.85rem 1.25rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e7eaf0;
}

.school-settings-row__control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.school-settings-row__control--checks {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.85rem;
}

.school-settings-row__control--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.school-settings-row__control--inline input[type="number"] {
  width: 5.5rem;
  padding: 0.3rem 0.45rem;
  font: inherit;
}

.school-settings-unit {
  font-size: 0.86rem;
  color: var(--shell-muted);
}

.school-settings-row__control label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.school-settings-row__control select {
  width: min(12rem, 100%);
  padding: 0.3rem 0.45rem;
  font: inherit;
}

.school-settings-row__help {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.school-settings-row__help--warning {
  color: #9a3412;
  font-weight: 600;
}

.school-settings-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.school-settings-fieldset > legend {
  padding: 0;
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.school-settings-targets-label {
  font-size: 0.82rem;
  color: var(--shell-muted);
  margin-left: 0.25rem;
}

.school-settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.school-settings-actions .hint {
  margin: 0;
}

.safe-document-upload {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.safe-document-upload > input[hidden] {
  display: none !important;
}

.safe-document-upload > input[type="file"]:not([hidden]) {
  width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  padding: 4px 6px;
  color: #1e293b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
}

.safe-document-upload > input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.3rem 0.65rem;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}

.safe-document-upload__status {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.safe-document-upload__status[data-state="processing"] {
  color: #1d4ed8;
}

.safe-document-upload__status[data-state="ready"] {
  color: #087443;
}

.safe-document-upload__status[data-state="error"] {
  color: #9f1d1d;
  font-weight: 600;
}

.school-legal-resubmission-form {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  align-items: start;
  gap: 0.55rem 0.75rem;
}

.school-legal-resubmission-form .safe-document-upload {
  min-width: 0;
}

.school-operator-view-request {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e7eaf0;
}

.school-operator-view-request__toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  min-width: 0;
}

.school-operator-view-request__toolbar h2 {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.school-operator-view-request .hint {
  margin: 0;
}

.school-operator-view-request .school-settings-caution {
  color: #9a3412;
}

.school-operator-view-request__form,
.school-operator-view-request__active {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.school-operator-view-request__form label {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.school-operator-view-request__form label span,
.school-operator-view-request__active span,
.school-operator-view-request__active strong {
  white-space: nowrap;
}

.school-operator-view-request__form input[type="number"] {
  width: 5.5rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
}

.school-operator-view-request__form button,
.school-operator-view-request__active button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.school-operator-view-request__full-access {
  padding: 0.2rem 0.45rem;
  border: 1px solid #f59e0b;
  border-radius: 0.45rem;
  color: #92400e;
  background: #fffbeb;
}

.school-operator-view-request__active {
  justify-content: flex-start;
}

.school-operator-view-request__active output {
  display: inline-block;
  min-width: 5.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.school-operator-view-request__active form {
  display: inline-flex;
  margin: 0;
}

/* 공용 휴지통 다이얼로그 (시간표 기초자료·생성/수정·운영 설정) */
.timetable-trash-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  padding: 16px 18px;
  border: 1px solid #c5ceda;
  border-radius: 8px;
  background: #fff;
  color: #24324a;
}

.timetable-trash-dialog::backdrop {
  background: rgba(24, 36, 58, 0.35);
}

.timetable-trash-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.timetable-trash-dialog__header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.timetable-trash-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.timetable-trash-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #f7f9fe;
}

.timetable-trash-list__rename {
  display: flex;
  flex: 1 1 280px;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.timetable-trash-list__rename input[type="text"] {
  flex: 1 1 160px;
  min-width: 120px;
}

.timetable-trash-empty {
  margin: 12px 0 0;
  color: #5b6b84;
}

@media (max-width: 720px) {
  .school-operator-view-request__toolbar,
  .school-operator-view-request__form,
  .school-operator-view-request__active,
  .school-operator-view-request__form label {
    flex-wrap: wrap;
  }

  .school-operator-view-request__active {
    justify-content: flex-start;
  }

  .school-settings-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .school-legal-resubmission-form {
    grid-template-columns: 1fr;
  }
}

.platform-definition-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #e7eaf0;
  border: 1px solid #e7eaf0;
  border-radius: 6px;
  overflow: hidden;
}

.platform-definition-list dt {
  margin: 0;
  padding: 10px 12px;
  background: #f4f6f9;
  color: var(--shell-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.platform-definition-list dd {
  margin: 0;
  padding: 10px 12px;
  background: #fff;
  text-align: center;
}

@media (max-width: 820px) {
  .platform-shell-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .platform-shell-header__main {
    width: 100%;
  }

  .platform-shell-tabs-rail {
    width: 100%;
  }

  .platform-shell-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .platform-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-shell-user {
    display: none;
  }

  .platform-shell-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-definition-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.platform-subscription-read-only {
  margin: 0;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1c36d;
  background: #fff7df;
  color: #694b0c;
  font-weight: 700;
  text-align: center;
}

.owner-reauthentication-dialog {
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #1e232b;
  box-shadow: 0 18px 48px rgb(15 23 42 / 24%);
}

.owner-reauthentication-dialog::backdrop {
  background: rgb(15 23 42 / 46%);
}

.owner-reauthentication-dialog [hidden] {
  display: none !important;
}

.owner-reauthentication-form {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px;
}

.owner-reauthentication-form header,
.owner-reauthentication-form header p {
  margin: 0;
}

.owner-reauthentication-form header {
  display: grid;
  gap: 5px;
}

.owner-reauthentication-form header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.owner-reauthentication-form header p {
  color: #64748b;
}

.owner-reauthentication-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.owner-reauthentication-form input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.owner-reauthentication-form__error {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #c24141;
  background: #fff1f2;
  color: #991b1b;
}

.owner-reauthentication-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 480px) {
  .owner-reauthentication-form {
    padding: 16px;
  }
}
