:root {
  --ink: #17211c;
  --muted: #66756c;
  --paper: #f4efe6;
  --card: #fffdf9;
  --line: #e4d9c8;
  --green: #1f7a4d;
  --green-deep: #145c38;
  --side: #14241c;
  --side-text: #d7e4db;
  --clay: #c56a3a;
  --bs-primary: #1f7a4d;
  --bs-primary-rgb: 31, 122, 77;
  --bs-link-color: #1f7a4d;
  --bs-link-hover-color: #145c38;
  --bs-body-color: #17211c;
  --bs-body-bg: #f4efe6;
  --bs-secondary-color: #66756c;
  --bs-border-radius: 0.9rem;
}

body {
  color: var(--ink);
  background: #e7e1d6;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

.phone {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fffdf9;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--side);
}

.topbar .brand {
  color: #fff;
  text-decoration: none;
}

.topbar-logout {
  color: #d7e4db;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  border-radius: 999px;
}

.topbar-logout:hover {
  color: var(--side);
  background: #fff;
}

.dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
}

.dock a {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.dock a.is-current {
  color: var(--green);
  background: #eef8f2;
}

.app-shell {
  min-height: 100vh;
}

.side {
  background: var(--side);
  color: var(--side-text);
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #8fd7a8;
  box-shadow: 0 0 0 4px rgba(143, 215, 168, 0.18);
}

.side-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.28rem;
}

.side-toggle span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.side-panel {
  padding: 0.2rem 0.75rem 0.9rem;
}

.side-links {
  display: grid;
  gap: 0.2rem;
}

.side .nav-link {
  color: var(--side-text);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
}

.side .nav-link:hover,
.side .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.side-logout {
  margin-top: 0.6rem;
}

.side-logout .btn {
  width: 100%;
  color: #d7e4db;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  border-radius: 999px;
}

.side-logout .btn:hover {
  color: #14241c;
  background: #fff;
}

.side .nav-link.is-current {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.side-sub {
  display: grid;
  gap: 0.1rem;
  margin: 0.1rem 0 0.35rem 0.65rem;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.side-sub .nav-link {
  padding: 0.4rem 0.65rem;
  font-size: 0.92rem;
}

.bot-list {
  display: grid;
  gap: 0.85rem;
}

.bot-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(36, 28, 16, 0.05);
}

.bot-card:hover {
  border-color: #8fc4a4;
  color: inherit;
}

.bot-index {
  color: var(--green);
  font-weight: 700;
}

.bot-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cohort-card {
  justify-items: center;
  padding: 1.45rem 1.15rem;
}

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

.page {
  width: 100%;
  margin: 0;
  padding: 0.9rem 0.85rem 1.1rem;
  flex: 1;
}

.page-title,
.sheet > h2 {
  letter-spacing: -0.04em;
  font-weight: 700;
}

.page-title {
  margin-bottom: 0.25rem;
  font-size: 1.45rem;
}

.lead-copy,
.sheet > .text-secondary {
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.sheet {
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid rgba(23, 33, 28, 0.06);
  border-radius: 1.4rem;
  padding: 1rem 0.9rem 1.05rem;
  margin-bottom: 1rem;
  box-shadow: 0 18px 40px rgba(36, 28, 16, 0.06);
  scroll-margin-top: 5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: none;
}

.sheet .card {
  background: #faf6f0;
}

.sheet .card.stat {
  background: #fff;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-value {
  margin-top: 0.3rem;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.4;
}

.sheet .card.stat-lead,
.stat-lead {
  color: #f6fbf8;
  background: linear-gradient(145deg, #17382c 0%, #1f7a4d 72%);
  border: 0;
}

.stat-lead .eyebrow {
  color: rgba(246, 251, 248, 0.74);
}

.stat-lead .stat-value {
  font-size: 1.35rem;
}

.stat-lead .btn-outline-primary,
.stat-lead .btn-outline-danger {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
}

.stat-lead .btn-outline-primary:hover,
.stat-lead .btn-outline-danger:hover {
  background: #fff;
  border-color: #fff;
}

.stat-lead .btn-outline-primary:hover {
  color: var(--green-deep);
}

.stat-lead .btn-outline-danger:hover {
  color: #9b2c2c;
}

.btn {
  border-radius: 999px;
  padding-inline: 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--green);
  --bs-btn-border-color: var(--green);
  --bs-btn-hover-bg: var(--green-deep);
  --bs-btn-hover-border-color: var(--green-deep);
  --bs-btn-active-bg: #0f4a2d;
  --bs-btn-active-border-color: #0f4a2d;
  --bs-btn-disabled-bg: var(--green);
  --bs-btn-disabled-border-color: var(--green);
}

.btn-outline-primary {
  --bs-btn-color: var(--green);
  --bs-btn-border-color: #b7d8c6;
  --bs-btn-hover-bg: var(--green);
  --bs-btn-hover-border-color: var(--green);
  --bs-btn-active-bg: var(--green-deep);
  --bs-btn-active-border-color: var(--green-deep);
}

.form-control,
.form-select {
  min-height: 2.75rem;
  border-color: #ddd2c2;
  border-radius: 0.85rem;
  background-color: #fff;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 0.2rem rgba(31, 122, 77, 0.16);
}

fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr));
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

fieldset legend {
  grid-column: 1 / -1;
  float: none;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}

fieldset .form-check,
.choice-list .form-check {
  margin: 0;
  padding: 0.8rem 0.85rem 0.8rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: #fff;
}

fieldset .form-check:has(input:checked),
.choice-list .form-check:has(input:checked) {
  border-color: #8fc4a4;
  background: #eef8f2;
}

.choice-list {
  display: grid;
  gap: 0.7rem;
}

.choice-list .btn,
.sheet form > .btn-primary {
  justify-self: start;
  width: auto;
}

main .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border-color: #cbbfae;
}

main .form-check-input:checked {
  background-color: var(--green);
  border-color: var(--green);
}

main .form-check-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 0.2rem rgba(31, 122, 77, 0.16);
}

.slot-card {
  margin-bottom: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #faf6f0;
}

.slot-card .card {
  border: 0;
  background: transparent;
}

.slot-delete {
  display: flex;
  justify-content: flex-end;
  padding: 0 1rem 0.85rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.preview {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  margin-bottom: 0;
  line-height: 1.55;
}

.badge {
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-weight: 600;
}

.status-scheduled,
.status-sending {
  color: #8a4b12;
  background: #fff1df;
}

.status-sent {
  color: #145c38;
  background: #e5f6ec;
}

.status-failed {
  color: #9b2c2c;
  background: #fdecea;
}

.status-cancelled {
  color: #66756c;
  background: #f1eee8;
}

.alert {
  border: 0;
  border-radius: 1rem;
}

.is-guest {
  --logo-navy: #1a2744;
  --logo-gold: #b89a6a;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(26, 39, 68, 0.12), transparent),
    #f8f7f4;
}

code {
  color: var(--clay);
}

.phone main .btn:not(.btn-sm),
.phone .action-row,
.phone .action-row form,
.phone .choice-list .btn,
.phone .sheet form > .btn-primary,
.phone .slot-delete,
.phone .slot-delete .btn {
  width: 100%;
}

.phone .slot-delete {
  justify-content: stretch;
}

.phone .btn:not(.btn-sm) {
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.88rem;
}

.phone .topbar-logout {
  min-height: 1.7rem;
  width: auto;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
}

.phone {
  font-size: 0.92rem;
}

.phone .topbar {
  padding: 0.4rem 0.7rem;
}

.phone .dock a {
  min-height: 2.45rem;
  font-size: 0.78rem;
}

.phone .page {
  padding: 0.55rem 0.55rem 0.7rem;
}

.phone .page-title {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.phone .sheet > h2,
.phone .sheet h3,
.phone .h4,
.phone .h5 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.phone .lead-copy,
.phone .sheet > .text-secondary,
.phone .form-text,
.phone .bot-note {
  font-size: 0.75rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.phone .sheet {
  padding: 0.6rem 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
  border-radius: 0.85rem;
  scroll-margin-top: 2.6rem;
}

.phone .card,
.phone .slot-card {
  border-radius: 0.7rem;
}

.phone .card-body {
  padding: 0.55rem;
}

.phone .mb-2 { margin-bottom: 0.3rem !important; }
.phone .mb-3 { margin-bottom: 0.4rem !important; }
.phone .mb-4 { margin-bottom: 0.5rem !important; }
.phone .mt-3 { margin-top: 0.4rem !important; }

.phone .form-label,
.phone fieldset legend {
  margin-bottom: 0.15rem;
  font-size: 0.75rem;
}

.phone .form-control,
.phone .form-select {
  min-height: 2rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.88rem;
  border-radius: 0.55rem;
}

.phone fieldset {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}

.phone fieldset .form-check,
.phone .choice-list .form-check {
  padding: 0.28rem 0.4rem 0.28rem 1.55rem;
  border-radius: 0.55rem;
}

.phone .form-check-input {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.15rem;
}

.phone .form-check-label {
  font-size: 0.82rem;
}

.phone .choice-list {
  gap: 0.35rem;
}

.phone .bot-list {
  gap: 0.45rem;
}

.phone .bot-card {
  padding: 0.65rem 0.7rem;
  gap: 0.1rem;
  border-radius: 0.8rem;
}

.phone .bot-name {
  font-size: 0.95rem;
}

.phone .slot-card {
  display: grid;
  grid-template-columns: 1.35fr 0.72fr 0.62fr auto auto auto;
  gap: 0.25rem;
  align-items: end;
  margin-bottom: 0.4rem;
  padding: 0.4rem;
}

.phone .slot-card .slot-edit,
.phone .slot-card .slot-grid,
.phone .slot-card .slot-delete {
  display: contents;
}

.phone .card .slot-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.72fr 0.62fr auto auto;
  gap: 0.25rem;
  align-items: end;
}

.phone .slot-use {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2rem;
}

.phone .slot-card .btn,
.phone .slot-delete .btn {
  width: auto;
  min-height: 2rem;
  padding: 0.15rem 0.4rem;
}

.phone .preview {
  padding: 0.55rem 0.6rem;
  font-size: 0.8rem;
}

.phone .alert {
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.is-guest .phone {
  width: 100%;
  background: transparent;
  justify-content: center;
}

.is-guest .page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.is-guest .page > .alert {
  width: min(400px, 100%);
  margin-bottom: 0.75rem;
}

.gate {
  width: min(400px, 100%);
  padding: 2.25rem 2rem;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26, 39, 68, 0.08);
}

.gate-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 1.25rem;
  text-decoration: none;
}

.logo-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-emblem {
  width: 42px;
  height: auto;
  color: var(--logo-navy);
}

.logo-type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-en {
  font-family: "Times New Roman", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.07em;
  color: var(--logo-navy);
  line-height: 1.05;
  text-align: center;
}

.logo-ko-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.logo-line {
  flex: 1 1 0;
  height: 1px;
  max-width: 56px;
  background: var(--logo-gold);
}

.logo-ko {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--logo-gold);
  white-space: nowrap;
}

.gate h1 {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: #1a2744;
}

.gate-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #78716c;
}

.gate-input {
  width: 100%;
  min-height: 0;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  background: #fff;
  color: #1c1917;
  font-size: 1rem;
}

.gate-input:focus {
  outline: none;
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.gate-submit {
  width: 100%;
  min-height: 0;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 10px;
  background: #b45309;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

.gate-submit:hover {
  background: #9a3412;
}

.gate-foot {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e7e5e4;
  text-align: center;
  font-size: 0.88rem;
}

.gate-foot a {
  color: #78716c;
  text-decoration: none;
}

.academy-shell {
  --bs-primary: #b45309;
  --bs-primary-rgb: 180, 83, 9;
  --green: #b45309;
  --green-deep: #9a3412;
  --ink: #1c1917;
  --muted: #78716c;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8f7f4;
  color: #1c1917;
}

.academy-shell .page-title,
.academy-shell .sheet > h2,
.academy-shell .sheet h3 {
  color: #1a2744;
}

.academy-shell .sheet,
.academy-shell .bot-card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
}

.academy-shell .bot-card:hover {
  border-color: #b45309;
}

.academy-shell .bot-index,
.academy-shell .btn-primary,
.academy-shell .btn-primary:hover,
.academy-shell .btn-primary:focus {
  background-color: #b45309;
  border-color: #b45309;
}

.academy-shell .bot-index {
  width: fit-content;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
}

.academy-shell .form-control:focus,
.academy-shell .form-select:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.academy-shell .admin-header .admin-btn {
  width: auto;
}

@media (max-width: 720px) {
  .academy-shell .admin-header .admin-btn,
  .academy-shell .admin-header-actions form .admin-btn {
    width: 100%;
  }
}


