:root {
  --cream: #f7f0e3;
  --paper: #fffaf1;
  --paper-deep: #f0e3cf;
  --terracotta: #b95e43;
  --terracotta-dark: #8e3f2b;
  --terracotta-pale: #f1d3c5;
  --sage: #7e9278;
  --sage-pale: #dde5d7;
  --green: #193b32;
  --green-soft: #2c5449;
  --ink: #2f382f;
  --muted: #6e756d;
  --line: #ded4c3;
  --danger: #a13b31;
  --shadow: 0 16px 40px rgba(67, 51, 35, 0.08);
  --sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Gowun Batang", "Batang", serif;
}

/* 공방 전환과 수업계획서 — Firebase 멀티공방 전환을 위한 화면 기반 */
.workspace-picker {
  display: grid;
  gap: 6px;
  margin: 4px 14px 18px;
  padding: 12px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
}
.workspace-picker span { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.workspace-picker select { width: 100%; padding: 9px 10px; color: #193b32; background: #fffdf7; border: 0; border-radius: 9px; font: inherit; font-weight: 700; }
.workspace-picker small { font-size: 10px; line-height: 1.45; }
.class-plan-editor { margin-top: 18px; padding: 18px; background: #fbf6e9; border: 1px dashed #c98c68; border-radius: 16px; }
.class-plan-title { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.class-plan-title div { display: grid; gap: 4px; }
.class-plan-title b { color: #193b32; }
.class-plan-title span { color: #75675c; font-size: 12px; }
.class-plan-title .document-badge { flex: 0 0 auto; padding: 5px 9px; color: #8d4e34; background: #f1dac9; border-radius: 999px; font-weight: 700; }
.class-plan-editor.is-hidden { display: none; }
@media (max-width: 760px) {
  .workspace-picker { margin-inline: 8px; }
  .class-plan-title { display: grid; }
}

.welcome-squirrel { width: min(300px, 72%); margin: auto; display: block; border-radius: 34% 34% 22% 22%; filter: drop-shadow(0 18px 24px rgba(33,31,24,.16)); }
.loading-mascot { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; gap: 12px; align-items: center; width: min(310px, calc(100vw - 32px)); padding: 12px 16px 12px 10px; color: #193b32; background: #fffdf7; border: 1px solid #e4d7c8; border-radius: 18px; box-shadow: 0 18px 48px rgba(25,59,50,.2); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .2s ease; }
.loading-mascot.is-visible { opacity: 1; transform: translateY(0); }
.loading-mascot img { width: 62px; height: 62px; object-fit: cover; border-radius: 16px; }
.loading-mascot span { font-size: 13px; font-weight: 700; }
.modal-mascot { display: block; width: 112px; height: 112px; object-fit: cover; margin: -68px auto 10px; border: 8px solid #fffdf7; border-radius: 30px; box-shadow: 0 12px 30px rgba(25,59,50,.14); }
.price-empty { display: flex; justify-content: center; align-items: center; gap: 18px; text-align: left; }
.price-empty img { width: 96px; height: 96px; object-fit: cover; border-radius: 24px; }
@media (prefers-reduced-motion: reduce) {
  .loading-mascot { transition: none; }
}

/* 일정·매출·출강 상태 */
.recent-section { margin-top: 22px; }
.job-list { display: grid; gap: 10px; }
.job-row { display: grid; grid-template-columns: 74px minmax(180px, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid #e6ddd2; border-radius: 14px; background: #fffdf9; }
.job-date { display: grid; color: #7a675b; }
.job-date b { color: #193b32; font-size: 15px; }
.job-date span, .job-main span { font-size: 11px; color: #84766b; }
.job-main { display: grid; gap: 4px; min-width: 0; }
.job-main strong, .job-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-pill.draft { color: #6e655d; background: #ece8e2; }
.status-pill.quoted { color: #8b4f32; background: #f6dfcf; }
.status-pill.confirmed { color: #174b3b; background: #cee6dc; }
.status-pill.completed { color: #fff; background: #1f5a47; }
.status-pill.cancelled { color: #7d3030; background: #f0d4d4; }
.job-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.job-actions button { padding: 6px 8px; border: 1px solid #d9cec1; border-radius: 8px; color: #41534c; background: #fff; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.job-actions button:hover { color: #fff; background: #2d5b4b; border-color: #2d5b4b; }
.job-actions .danger-link { color: #a84a3a; }
.job-empty { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 26px; color: #78695e; text-align: left; }
.job-empty img { width: 86px; height: 86px; object-fit: cover; border-radius: 22px; }
.job-empty.compact { padding: 18px; text-align: center; }

.calendar-toolbar, .revenue-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-toolbar > div, .revenue-toolbar > div { text-align: center; }
.calendar-toolbar span, .revenue-toolbar > div span { color: #9b694d; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.calendar-toolbar h3, .revenue-toolbar h3 { margin: 3px 0 0; color: #193b32; font: 700 24px 'Gowun Batang', serif; }
.month-move { width: 42px; height: 42px; background: #edf3ef; }
.status-legend { display: flex; flex-wrap: wrap; gap: 15px; margin: 0 4px 12px; color: #71645b; font-size: 11px; }
.status-legend span { display: flex; align-items: center; gap: 5px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; }
.status-dot.draft { background: #c7beb5; }.status-dot.quoted { background: #d58b64; }.status-dot.confirmed { background: #5d9b84; }.status-dot.completed { background: #1f5a47; }
.calendar-card { padding: 0; overflow: hidden; margin-bottom: 18px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: #76675d; background: #eee9e1; font-size: 11px; font-weight: 800; text-align: center; }
.calendar-weekdays span { padding: 10px 4px; }
.calendar-day { min-height: 108px; padding: 8px; border-top: 1px solid #e8dfd5; border-right: 1px solid #e8dfd5; background: #fffefa; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day > b { display: inline-grid; place-items: center; width: 24px; height: 24px; color: #32483f; font-size: 11px; }
.calendar-day.is-muted { background: #f7f4ef; opacity: .48; }
.calendar-day.is-today > b { color: #fff; background: #b76243; border-radius: 50%; }
.calendar-job { display: block; margin-top: 4px; padding: 4px 5px; overflow: hidden; border-radius: 5px; color: #fff; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-job.draft { color: #5e554e; background: #ddd7cf; }.calendar-job.quoted { background: #c77b58; }.calendar-job.confirmed { background: #4d8b73; }.calendar-job.completed { background: #1f5a47; }.calendar-job.cancelled { background: #a85c5c; }
.calendar-day small { display: block; margin-top: 4px; color: #8b7769; font-size: 9px; }

.revenue-toolbar > div { text-align: left; }
.revenue-toolbar .field { width: 180px; }
.revenue-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { display: grid; gap: 7px; min-height: 130px; padding: 20px; border-radius: 18px; color: #fff; box-shadow: 0 12px 26px rgba(38,49,43,.11); }
.metric-card span { font-size: 11px; opacity: .78; }.metric-card strong { font-size: 22px; }.metric-card small { align-self: end; font-size: 10px; opacity: .7; }
.metric-card.terracotta { background: #ad6044; }.metric-card.green { background: #235845; }.metric-card.sage { background: #718c77; }.metric-card.ink { background: #303d39; }
.revenue-table-wrap { overflow-x: auto; }
.revenue-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.revenue-table th, .revenue-table td { padding: 12px 10px; border-bottom: 1px solid #e5ddd4; text-align: left; white-space: nowrap; }
.revenue-table th { color: #75665b; background: #f7f3ec; font-size: 10px; }
.empty-cell { padding: 30px !important; color: #86776c; text-align: center !important; }

@media (max-width: 980px) {
  .revenue-stats { grid-template-columns: repeat(2, 1fr); }
  .job-row { grid-template-columns: 62px minmax(130px, 1fr) auto; }
  .job-actions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .calendar-day { min-height: 78px; padding: 4px; }
  .calendar-job { font-size: 0; height: 8px; padding: 0; border-radius: 999px; }
  .calendar-day small { display: none; }
  .revenue-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 110px; padding: 15px; }.metric-card strong { font-size: 17px; }
  .job-row { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 9px; }
}

* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: var(--sans); }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.mailto-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  background: var(--paper);
}
.login-art {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: 8vw 6vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--green);
  color: var(--paper);
}
.login-art::after {
  content: "";
  position: absolute;
  width: 22rem;
  height: 22rem;
  right: -7rem;
  bottom: -8rem;
  border-radius: 44% 56% 63% 37% / 41% 47% 53% 59%;
  background: var(--terracotta);
  opacity: 0.88;
}
.clay-orbit { position: absolute; border: 1px solid rgba(255,250,241,.22); border-radius: 50%; }
.orbit-one { width: 26rem; height: 26rem; left: -10rem; top: -7rem; }
.orbit-two { width: 17rem; height: 17rem; left: 6rem; top: 8rem; }
.login-mark { position: absolute; top: 8vw; left: 6vw; width: 82px; height: 82px; border-radius: 42% 58% 57% 43% / 48% 42% 58% 52%; background: var(--paper); display: grid; place-items: center; transform: rotate(-5deg); }
.login-mark svg { width: 55px; fill: var(--terracotta); transform: rotate(5deg); }
.login-art > p { position: relative; z-index: 1; margin: 0; max-width: 430px; font: 700 clamp(2rem, 3.7vw, 4.4rem)/1.3 var(--serif); letter-spacing: -.04em; }
.login-panel { align-self: center; justify-self: center; width: min(470px, calc(100% - 48px)); padding: 48px 0; }
.eyebrow { color: var(--terracotta-dark); font-size: 12px; font-weight: 700; letter-spacing: .17em; }
.login-panel h1 { margin: 14px 0 22px; font: 700 clamp(2.7rem, 5vw, 4.8rem)/1 var(--serif); letter-spacing: -.06em; color: var(--green); }
.login-panel h1 span { font: 700 14px/1 var(--sans); display: inline-block; padding: 6px 9px; margin-left: 8px; vertical-align: top; border-radius: 999px; background: var(--terracotta-pale); color: var(--terracotta-dark); letter-spacing: 0; }
.login-lead { margin: 0 0 34px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.auth-methods { display: grid; gap: 12px; }
.auth-method-button { width: 100%; min-height: 54px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 8px 24px rgba(55,45,32,.06); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.google-login svg { width: 22px; }
.auth-method-button:hover { border-color: var(--terracotta); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(55,45,32,.09); }
.auth-method-button:focus-visible, .email-auth-field input:focus-visible, .email-submit:focus-visible, .email-reset:focus-visible { outline: 3px solid rgba(180,91,57,.22); outline-offset: 2px; }
.email-login-toggle { background: var(--terracotta-pale); border-color: rgba(180,91,57,.24); color: var(--terracotta-dark); }
.email-login-icon { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--terracotta); color: #fff; font-size: 14px; font-weight: 700; }
.email-auth-panel { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(55,45,32,.07); }
.email-auth-heading { display: grid; gap: 4px; margin-bottom: 16px; }
.email-auth-heading strong { color: var(--green); font-size: 15px; }
.email-auth-heading span { color: var(--muted); font-size: 12px; }
.email-auth-field { display: grid; gap: 7px; margin-top: 12px; color: var(--ink); font-size: 12px; font-weight: 700; }
.email-auth-field input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 14px; }
.email-auth-field input::placeholder { color: #9a9d98; }
.email-auth-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 16px; }
.email-submit { min-height: 45px; justify-content: center; }
.email-reset { display: block; margin: 14px auto 0; padding: 3px 5px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.email-reset:hover { color: var(--terracotta-dark); }
.email-auth-message { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.email-auth-message.is-error { color: #a84232; }
.email-auth-message.is-success { color: var(--green); }
.prototype-note { margin: 16px 4px 0; color: #858a84; font-size: 12px; line-height: 1.65; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px 1fr; background: var(--cream); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 254px; z-index: 10; display: flex; flex-direction: column; padding: 28px 18px 18px; color: var(--paper); background: var(--green); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { width: 42px; height: 42px; border-radius: 41% 59% 61% 39% / 46% 42% 58% 54%; display: grid; place-items: center; background: var(--terracotta); }
.brand-mark svg { width: 30px; fill: var(--paper); }
.brand strong, .brand span, .sidebar-foot strong, .sidebar-foot span { display: block; }
.brand strong { font-family: var(--serif); font-size: 18px; }
.brand span { margin-top: 3px; color: rgba(255,250,241,.58); font-size: 11px; }
.primary-nav { padding: 24px 0; display: grid; gap: 7px; }
.nav-item { width: 100%; height: 45px; padding: 0 12px; border: 0; border-radius: 10px; color: rgba(255,250,241,.72); background: transparent; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 7px; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active { background: var(--paper); color: var(--green); font-weight: 700; }
.nav-icon { font-size: 18px; text-align: center; }
.nav-item small { padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.6); font-size: 9px; }
.nav-divider { margin: 14px 8px 6px; height: 1px; background: rgba(255,255,255,.12); position: relative; }
.nav-divider span { position: absolute; top: -9px; left: 0; padding-right: 8px; background: var(--green); color: rgba(255,255,255,.42); font-size: 10px; }
.sidebar-foot { margin-top: auto; display: grid; grid-template-columns: 35px 1fr 32px; align-items: center; gap: 9px; padding: 15px 8px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.account-dot { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: var(--terracotta-pale); color: var(--terracotta-dark); font-weight: 700; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot span { margin-top: 2px; color: rgba(255,255,255,.52); font-size: 10px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 8px; color: rgba(255,255,255,.65); background: transparent; font-size: 20px; }
.icon-button:hover { background: rgba(255,255,255,.08); }

.workspace { grid-column: 2; min-width: 0; padding: 0 42px 108px; }
.topbar { height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.today-label { margin: 0 0 4px; color: var(--terracotta-dark); font-size: 12px; font-weight: 700; }
.topbar h2 { margin: 0; font: 700 29px/1.2 var(--serif); letter-spacing: -.04em; color: var(--green); }
.connection-state { padding: 8px 12px; border: 1px solid #c9d7c5; border-radius: 999px; color: var(--green-soft); background: rgba(255,250,241,.7); font-size: 11px; }
.connection-state span { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--sage); }
.view { display: none; }
.view.is-active { display: block; animation: page-in .28s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.workboard { display: grid; grid-template-columns: minmax(210px, 1.45fr) repeat(3, minmax(115px, .55fr)); gap: 11px; margin-bottom: 22px; }
.workboard-intro, .glaze-tile { min-height: 90px; border-radius: 26px 12px 22px 10px; padding: 18px 20px; }
.workboard-intro { border: 1px solid var(--line); background: rgba(255,250,241,.56); }
.workboard-intro span, .workboard-intro strong, .glaze-tile span, .glaze-tile strong { display: block; }
.workboard-intro span { color: var(--terracotta-dark); font-size: 11px; font-weight: 700; }
.workboard-intro strong { margin-top: 7px; font: 700 20px/1.3 var(--serif); color: var(--green); }
.glaze-tile { position: relative; overflow: hidden; color: white; }
.glaze-tile::after { content: ""; position: absolute; width: 70px; height: 70px; right: -19px; top: -24px; border-radius: 50%; background: rgba(255,255,255,.15); }
.glaze-tile span { position: relative; z-index: 1; font-size: 11px; opacity: .78; }
.glaze-tile strong { position: relative; z-index: 1; margin-top: 7px; font: 700 27px/1 var(--serif); }
.glaze-tile.terracotta { background: var(--terracotta); }
.glaze-tile.sage { background: var(--sage); }
.glaze-tile.green { background: var(--green-soft); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .72fr); gap: 20px; align-items: start; }
.form-stack, .summary-stack { display: grid; gap: 16px; }
.paper-card, .price-card, .mail-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 8px 28px rgba(76,60,39,.035); }
.paper-card, .mail-card { padding: 24px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-heading > span { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--green); }
.section-heading small { color: var(--muted); font-size: 10px; }
.field-grid { display: grid; gap: 16px 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.span-three { grid-column: span 3; }
.field { display: block; min-width: 0; }
.field > span { display: block; margin: 0 0 7px; color: #525b52; font-size: 11px; font-weight: 600; }
.field em { margin-left: 4px; color: var(--terracotta-dark); font-size: 9px; font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fffdfa; color: var(--ink); transition: border .16s, box-shadow .16s; }
.field input, .field select { height: 43px; padding: 0 12px; }
.field textarea { padding: 12px; resize: vertical; line-height: 1.62; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(126,146,120,.15); }
.field input::placeholder, .field textarea::placeholder { color: #a8aaa4; }
.field.compact + .field.compact { margin-top: 13px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 38px; }
.input-suffix b { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.doc-check { position: relative; }
.doc-check input { position: absolute; opacity: 0; pointer-events: none; }
.doc-check > span { min-height: 54px; padding: 10px 10px 10px 34px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; display: flex; flex-direction: column; justify-content: center; font-size: 12px; }
.doc-check > span::before { content: ""; position: absolute; left: 11px; top: 17px; width: 15px; height: 15px; border: 1px solid #b9b4aa; border-radius: 4px; }
.doc-check input:checked + span { border-color: #dd9c87; background: #fbede6; color: var(--terracotta-dark); font-weight: 600; }
.doc-check input:checked + span::before { content: "✓"; display: grid; place-items: center; border-color: var(--terracotta); background: var(--terracotta); color: white; font-size: 10px; }
.doc-check small { margin-top: 2px; color: var(--terracotta); font-size: 8px; }

.price-card { overflow: hidden; border-color: #d4b19f; background: #f9e8dc; }
.price-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 21px 14px; color: var(--terracotta-dark); }
.price-head span { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.price-head small { padding: 4px 7px; border-radius: 999px; background: rgba(185,94,67,.13); font-size: 9px; }
.price-card dl { margin: 0; padding: 0 21px; }
.price-card dl > div { min-height: 40px; border-bottom: 1px solid rgba(142,63,43,.13); display: flex; align-items: center; justify-content: space-between; }
.price-card dt { color: #875848; font-size: 11px; }
.price-card dd { margin: 0; color: #713524; font-size: 13px; font-weight: 600; }
.price-card .total { min-height: 62px; border-bottom: 0; }
.price-card .total dt { font-family: var(--serif); font-size: 15px; font-weight: 700; }
.price-card .total dd { font-family: var(--serif); font-size: 20px; }
.price-card > .field { margin: 0 21px 14px; }
.price-card > .field:last-child { margin-bottom: 21px; }
.mail-card { padding: 20px; }

.action-bar { position: fixed; z-index: 8; left: 254px; right: 0; bottom: 0; min-height: 82px; padding: 13px 42px; border-top: 1px solid var(--line); background: rgba(255,250,241,.94); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.action-note { color: var(--muted); font-size: 10px; }
.action-note span { color: var(--sage); }
.action-buttons { display: flex; gap: 9px; }
.button { min-height: 42px; padding: 0 17px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 12px; }
.button.primary { background: var(--green); color: var(--paper); }
.button.primary:hover { background: var(--green-soft); }
.button.secondary { border-color: #d7b19d; background: #f5ded1; color: var(--terracotta-dark); }
.button.outline { border-color: var(--line); background: var(--paper); color: var(--green); }
.button.small { min-height: 35px; padding: 0 12px; font-size: 10px; }

.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 850px); gap: 20px; align-items: start; }
.settings-nav { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,250,241,.55); }
.settings-nav button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 11px; }
.settings-nav button:hover { background: rgba(255,255,255,.8); }
.settings-nav button.is-active { background: var(--green); color: white; font-weight: 700; }
.settings-panel { display: none; }
.settings-panel.is-active { display: block; animation: page-in .22s ease-out; }
.settings-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-title span { font: 700 20px/1.3 var(--serif); color: var(--green); }
.settings-title p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.settings-title .save-state { padding: 4px 8px; border-radius: 999px; background: var(--sage-pale); color: var(--green); font: 700 9px/1.4 var(--sans); }
.panel-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.pricebook-guide { margin: -8px 0 16px; padding: 11px 13px; border-radius: 10px; background: var(--sage-pale); color: var(--green-soft); display: flex; justify-content: space-between; gap: 14px; font-size: 9px; line-height: 1.55; }
.pricebook-guide b { font-weight: 700; }
.price-group-list { display: grid; gap: 14px; }
.price-group { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fffdfa; }
.price-group.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(161,59,49,.1); }
.price-group-head { min-height: 58px; padding: 10px 12px 10px 15px; border-bottom: 1px solid var(--line); background: #f7f1e7; display: grid; grid-template-columns: auto minmax(180px, 1fr) auto auto; align-items: center; gap: 10px; }
.price-group-number { width: 27px; height: 27px; border-radius: 48% 52% 58% 42% / 44% 48% 52% 56%; background: var(--terracotta-pale); color: var(--terracotta-dark); display: grid; place-items: center; font: 700 11px/1 var(--serif); }
.price-group-name { height: 37px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; outline: 0; background: transparent; color: var(--green); font: 700 14px/1.2 var(--serif); }
.price-group-name:hover, .price-group-name:focus { border-color: var(--line); background: #fff; }
.tier-count { padding: 4px 8px; border-radius: 999px; background: var(--sage-pale); color: var(--green-soft); font-size: 9px; white-space: nowrap; }
.delete-item, .delete-tier { border: 0; border-radius: 7px; background: #f5e4dc; color: var(--danger); }
.delete-item { min-height: 32px; padding: 0 9px; font-size: 9px; }
.price-tier-list { padding: 8px 12px 12px; }
.tier-labels, .price-tier { display: grid; grid-template-columns: minmax(75px, .7fr) 18px minmax(75px, .7fr) minmax(130px, 1fr) 32px; align-items: center; gap: 8px; }
.tier-labels { min-height: 28px; color: var(--muted); font-size: 8px; }
.price-tier { min-height: 48px; border-top: 1px solid #eee6da; }
.price-tier:first-of-type { border-top: 0; }
.price-tier input { width: 100%; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); font-size: 11px; }
.price-tier input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(126,146,120,.13); }
.tier-separator { color: var(--muted); font-size: 10px; text-align: center; }
.price-input-wrap { position: relative; }
.price-input-wrap input { padding-right: 25px; text-align: right; }
.price-input-wrap span { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 9px; pointer-events: none; }
.delete-tier { width: 30px; height: 30px; font-size: 16px; }
.add-tier { min-height: 34px; margin-top: 7px; padding: 0 11px; border: 1px dashed #cbbfac; border-radius: 8px; background: transparent; color: var(--terracotta-dark); font-size: 9px; font-weight: 700; }
.price-empty { padding: 28px; border: 1px dashed #cbbfac; border-radius: 12px; color: var(--muted); background: #fffdfa; text-align: center; font-size: 11px; }
.file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.file-drop { min-height: 145px; padding: 20px; border: 1px dashed #cbbfac; border-radius: 12px; background: #fffdfa; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.file-drop:hover { border-color: var(--sage); background: #f7f8f2; }
.file-drop.is-disabled { cursor: not-allowed; opacity: .62; background: #f3f0ea; }
.file-drop.is-disabled:hover { border-color: #cbbfac; background: #f3f0ea; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop b { color: var(--green); font: 700 15px/1.4 var(--serif); }
.file-drop span { margin-top: 8px; color: var(--muted); font-size: 9px; }
.info-note { margin: 18px 0 0; padding: 12px 14px; border-radius: 9px; background: var(--sage-pale); color: var(--green-soft); font-size: 10px; line-height: 1.6; }
.account-list { display: grid; gap: 8px; }
.account-row { min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; }
.account-row strong, .account-row span { display: block; }
.account-row strong { font-size: 12px; }
.account-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-row > b { padding: 4px 8px; border-radius: 999px; background: var(--sage-pale); color: var(--green); font-size: 9px; }
.mobile-nav { display: none; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 999px; background: var(--green); color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s; font-size: 11px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.modal { width: min(450px, calc(100% - 32px)); padding: 28px; border: 0; border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 90px rgba(25,59,50,.25); }
.modal::backdrop { background: rgba(25,59,50,.55); backdrop-filter: blur(3px); }
.modal-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 42% 58% 60% 40% / 48% 42% 58% 52%; background: var(--terracotta-pale); color: var(--terracotta-dark); font-weight: 700; }
.modal h3 { margin: 15px 0 10px; font: 700 22px/1.3 var(--serif); color: var(--green); }
.modal #modal-content { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.modal #modal-content strong { color: var(--ink); }

@media (max-width: 1050px) {
  .workspace { padding-left: 26px; padding-right: 26px; }
  .content-grid { grid-template-columns: 1fr; }
  .summary-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-bar { padding-left: 26px; padding-right: 26px; }
  .workboard { grid-template-columns: 1.3fr repeat(3, .6fr); }
}

@media (max-width: 800px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { min-height: 280px; padding: 34px 28px; justify-content: flex-end; }
  .login-mark { top: 32px; left: 28px; width: 60px; height: 60px; }
  .login-mark svg { width: 42px; }
  .login-art > p { font-size: 2.3rem; }
  .login-panel { padding: 48px 0 72px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding: 0 18px 120px; }
  .topbar { height: 94px; }
  .connection-state { display: none; }
  .workboard { grid-template-columns: repeat(3, 1fr); }
  .workboard-intro { grid-column: span 3; min-height: 76px; }
  .content-grid, .summary-stack { grid-template-columns: 1fr; }
  .action-bar { left: 0; bottom: 63px; padding: 10px 18px; }
  .action-note { display: none; }
  .action-buttons { width: 100%; }
  .action-buttons .button { flex: 1; padding-inline: 8px; }
  .mobile-nav { position: fixed; z-index: 12; inset: auto 0 0; height: 64px; border-top: 1px solid var(--line); background: rgba(255,250,241,.97); display: grid; grid-template-columns: repeat(5, 1fr); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; }
  .mobile-nav button span { font-size: 17px; }
  .mobile-nav button.is-active { color: var(--terracotta-dark); font-weight: 700; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: auto; }
  .settings-nav button { text-align: center; padding: 0 6px; font-size: 9px; }
}

/* 캘린더 메모 · 결제 구분 · 통일 수업계획서 */
.calendar-day { color: inherit; font: inherit; text-align: left; cursor: pointer; }
.calendar-day:disabled { cursor: default; }
.calendar-day:not(:disabled):hover { position: relative; z-index: 1; outline: 2px solid #c98c68; outline-offset: -2px; }
.calendar-note-chip { display: block; margin-top: 4px; padding: 4px 5px; overflow: hidden; border-radius: 5px; color: #3b3029; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.calendar-note-chip.clay { background: #f2d5c5; }.calendar-note-chip.sage { background: #dbe5d4; }.calendar-note-chip.blue { background: #d8e7e6; }
.calendar-note-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; margin-bottom: 18px; }
.important-check { display: flex; align-items: center; gap: 9px; padding: 12px; color: #7b4d35; background: #fbefe3; border: 1px solid #ecd5c2; border-radius: 11px; font-size: 12px; font-weight: 800; }
.important-check input { accent-color: var(--terracotta); }
.note-actions { flex-wrap: wrap; }
.important-note-list { display: grid; gap: 8px; }
.important-note-item { display: grid; gap: 3px; width: 100%; padding: 11px 12px; border: 1px solid #e1d6ca; border-left: 5px solid #b95e43; border-radius: 11px; color: var(--ink); background: #fffdf9; text-align: left; }
.important-note-item.sage { border-left-color: #7e9278; }.important-note-item.blue { border-left-color: #5f8e8a; }
.important-note-item span,.important-note-item small { color: var(--muted); font-size: 10px; }.important-note-item strong { font-size: 12px; }
.text-button { padding: 5px 8px; border: 0; border-radius: 8px; color: var(--terracotta-dark); background: #f7e5d8; font-size: 10px; font-weight: 800; }

.class-plan-linker { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 14px; align-items: end; margin-top: 16px; padding: 16px; background: #fbf6e9; border: 1px dashed #c98c68; border-radius: 15px; }
.class-plan-linker small { grid-column: 1 / -1; color: #75675c; font-size: 11px; line-height: 1.55; }
.plan-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; align-items: start; }
.plan-library { position: sticky; top: 96px; }
.plan-list { display: grid; gap: 8px; }
.plan-list-item { display: grid; gap: 5px; width: 100%; padding: 13px; border: 1px solid #e3d8cb; border-radius: 12px; color: var(--ink); background: #fffdf9; text-align: left; }
.plan-list-item span { color: var(--muted); font-size: 10px; }.plan-list-item.is-active { border-color: #a65b41; background: #f8e7dc; box-shadow: inset 4px 0 #a65b41; }
.plan-sheet-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 3px solid var(--green); }
.plan-sheet-heading span { color: #9a6346; font-size: 10px; font-weight: 800; letter-spacing: .08em; }.plan-sheet-heading h3 { margin: 6px 0 0; color: var(--green); font: 700 25px var(--serif); }
.plan-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 24px 0 10px; }.plan-section-heading div { display: grid; gap: 3px; }.plan-section-heading span { color: var(--muted); font-size: 11px; }
.plan-session-list { display: grid; gap: 8px; }
.plan-session-row { display: grid; grid-template-columns: 80px 80px minmax(220px,1fr) minmax(140px,.55fr) 80px 34px; gap: 7px; align-items: stretch; }
.plan-session-row input,.plan-session-row textarea { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fffefa; font: inherit; font-size: 11px; resize: vertical; }
.delete-plan-session { border: 1px solid #e4c6bf; border-radius: 9px; color: #a13b31; background: #fff7f4; }
.plan-extra-fields { margin-top: 22px; }
.plan-pattern-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 10px; align-items: end; margin: 18px 0 22px; padding: 15px; border: 1px solid #e5d4c4; border-radius: 14px; background: #fcf6eb; }
.plan-review-status { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 15px 17px; border: 1px solid #e2d6c7; border-left: 6px solid #b78668; border-radius: 13px; background: #fffaf2; }
.plan-review-status[data-status="reviewing"] { border-left-color: #d29b36; background: #fff9e8; }.plan-review-status[data-status="confirmed"] { border-left-color: #39735f; background: #edf7f1; }
.plan-status-copy { display: grid; gap: 3px; }.plan-status-copy span { color: #9a4e31; font-size: 10px; font-weight: 900; letter-spacing: .05em; }.plan-status-copy strong { color: var(--ink); font-size: 14px; }.plan-status-copy small { color: var(--muted); font-size: 10px; }
.plan-status-steps { display: flex; gap: 6px; flex: 0 0 auto; }.plan-status-steps span { padding: 7px 9px; border-radius: 999px; color: #877b70; background: #eee7de; font-size: 9px; font-weight: 800; }.plan-status-steps span.is-active { color: white; background: var(--green); }
.plan-list-item { position: relative; padding-right: 82px; }.plan-list-status { position: absolute; top: 11px; right: 10px; padding: 4px 7px; border-radius: 999px; color: #7f6b5e; background: #eee7de; font-size: 8px; font-style: normal; font-weight: 900; }.plan-list-status.reviewing { color: #805d13; background: #f8e6ad; }.plan-list-status.confirmed { color: #245746; background: #d7eadf; }
.plan-review-panel { margin-top: 18px; }.plan-review-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 13px; }.plan-review-heading div { display: grid; gap: 4px; }.plan-review-heading span { color: #9a6346; font-size: 10px; font-weight: 800; }.plan-review-heading h4 { margin: 0; color: var(--green); font: 700 20px var(--serif); }
.plan-review-content { padding: 20px; border: 1px solid #d9cec1; border-radius: 14px; background: #fffefb; box-shadow: inset 0 0 0 5px #f8f2e9; }.review-document { display: grid; gap: 10px; }.review-document header { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-bottom: 12px; border-bottom: 3px solid var(--green); }.review-document header span { color: #9a6346; font-size: 10px; }.review-document header h3 { grid-column: 1 / -1; margin: 0; color: var(--green); font-size: 22px; }.review-document header b { grid-column: 2; grid-row: 1; font-size: 11px; }.review-document section { padding: 11px 12px; border: 1px solid #e3d9cc; border-radius: 10px; break-inside: avoid; }.review-document h5 { margin: 0 0 7px; color: var(--green); font-size: 12px; }.review-document p { margin: 0; color: #433b35; font-size: 11px; line-height: 1.65; }
.review-goals { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }.review-goals li { display: grid; grid-template-columns: 24px 1fr; color: #433b35; font-size: 11px; line-height: 1.55; }.review-goals b { color: var(--terracotta-dark); }.review-summary { display: grid; grid-template-columns: repeat(2,1fr); margin: 0; border: 1px solid #ded4c8; border-radius: 8px; overflow: hidden; }.review-summary div { display: grid; grid-template-columns: 76px 1fr; }.review-summary dt,.review-summary dd { margin: 0; padding: 8px; border-bottom: 1px solid #e6ddd2; font-size: 10px; }.review-summary dt { color: #5d554e; background: #f5f0e7; font-weight: 800; }.review-table-wrap { overflow-x: auto; }.review-document table { width: 100%; border-collapse: collapse; }.review-document th,.review-document td { padding: 7px; border: 1px solid #d7cdbf; font-size: 10px; line-height: 1.5; text-align: left; vertical-align: top; }.review-document th { background: #f5f0e7; }.plan-confirmation-note { padding: 10px!important; border-radius: 9px; color: #245746!important; background: #e1f0e7; font-weight: 800; text-align: center; }.plan-review-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.button:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(.25); }

.revenue-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }.revenue-filters .field { width: 150px; }
.payment-breakdown { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: -5px 0 18px; }
.payment-breakdown article { display: flex; justify-content: space-between; gap: 10px; padding: 13px 15px; border: 1px solid #ded5c9; border-radius: 13px; background: #fffaf2; }.payment-breakdown span { color: var(--muted); font-size: 11px; }.payment-breakdown strong { color: var(--green); font-size: 13px; }
.payment-pill,.collection-pill { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }.payment-pill.card { color: #7c3f27; background: #f5d8c6; }.payment-pill.bank { color: #1e5847; background: #d7e8df; }.payment-pill.undecided { color: #68615b; background: #ece8e3; }.collection-pill.paid { color: white; background: #2b6552; }.collection-pill.unpaid { color: #8f4b35; background: #f7e3d6; }

@media (max-width: 1100px) {
  .plan-workspace { grid-template-columns: 1fr; }.plan-library { position: static; }.plan-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .plan-session-row { grid-template-columns: 70px 70px minmax(180px,1fr) minmax(120px,.6fr) 70px 32px; }
  .plan-pattern-toolbar { grid-template-columns: repeat(3,minmax(0,1fr)); }.plan-pattern-toolbar .button { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .calendar-note-layout { grid-template-columns: 1fr; }.class-plan-linker { grid-template-columns: 1fr; }.class-plan-linker small { grid-column: auto; }
  .plan-list { grid-template-columns: 1fr; }.plan-sheet-heading { display: grid; }
  .plan-session-row { grid-template-columns: 1fr 1fr 36px; padding: 10px; border: 1px solid #e2d7ca; border-radius: 12px; background: #fffdf9; }.plan-session-row .session-content,.plan-session-row .session-materials { grid-column: 1 / -1; }.plan-session-row .session-manager { grid-column: 1 / 3; }
  .plan-pattern-toolbar { grid-template-columns: 1fr; }.plan-pattern-toolbar .button { grid-column: auto; }.plan-review-status { display: grid; }.plan-status-steps { width: 100%; }.plan-status-steps span { flex: 1; text-align: center; }.review-summary { grid-template-columns: 1fr; }
  .revenue-filters { justify-content: stretch; }.revenue-filters .field { width: 100%; }.payment-breakdown { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar h2 { font-size: 24px; }
  .workboard { gap: 7px; }
  .glaze-tile { padding: 14px 11px; min-height: 78px; }
  .glaze-tile span { font-size: 9px; }
  .paper-card, .mail-card { padding: 18px; }
  .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
  .span-two, .span-three, .span-two-mobile { grid-column: span 1; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .file-grid { grid-template-columns: 1fr; }
  .settings-title { flex-direction: column; }
  .pricebook-guide { flex-direction: column; }
  .price-group-head { grid-template-columns: auto 1fr auto; }
  .tier-count { display: none; }
  .delete-item { grid-column: 2 / 4; justify-self: end; }
  .tier-labels { display: none; }
  .price-tier { grid-template-columns: 1fr 15px 1fr; padding: 9px 0; }
  .price-tier .price-input-wrap { grid-column: 1 / 3; }
  .price-tier .delete-tier { grid-column: 3; grid-row: 2; justify-self: end; }
  .action-buttons .button { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== 1단계 (2026-11-27): 무지 먼슬리 플래너 모양 달력과 메모 ===== */
#view-calendar {
  --cal-ink: #26231f;
  --cal-sub: #8a847a;
  --cal-line: #dcd7cd;
  --cal-red: #c23f2c;
  color: var(--cal-ink);
}
.app-shell[data-view="calendar"] .workspace { background: #f7f5f0; }
.app-shell[data-view="calendar"] .topbar { display: none; }
.app-shell[data-view="calendar"] .workspace { padding-top: 34px; }
.cal-board { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; align-items: start; }
.cal-side { position: sticky; top: 20px; padding-right: 22px; border-right: 1px solid var(--cal-line); }
.cal-month strong { display: block; font: 300 92px/0.9 var(--sans); letter-spacing: -4px; color: var(--cal-ink); }
.cal-month span { display: block; margin: 10px 0 14px; color: var(--cal-sub); font-size: 15px; letter-spacing: .03em; }
.cal-arrows { display: flex; gap: 6px; margin-bottom: 26px; }
.cal-arrow { min-width: 40px; height: 36px; padding: 0 10px; border: 1px solid var(--cal-line); background: transparent; color: var(--cal-ink); font-size: 15px; border-radius: 2px; }
.cal-arrow:hover { border-color: var(--cal-ink); }
.cal-memo-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--cal-ink); font-size: 13px; color: var(--cal-sub); }
.cal-text-button { border: 0; background: none; color: var(--cal-ink); font-size: 14px; padding: 4px 0; }
.cal-memo-lines { list-style: none; margin: 0; padding: 0; }
.cal-memo-lines li { min-height: 38px; border-bottom: 1px solid var(--cal-line); }
.cal-memo-lines button { width: 100%; min-height: 38px; border: 0; background: none; text-align: left; padding: 8px 0; color: var(--cal-ink); font-size: 15px; line-height: 1.4; }
.cal-who { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--cal-line); color: var(--cal-sub); font-size: 11px; font-weight: 400; vertical-align: 2px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--cal-ink); border-bottom: 1px solid var(--cal-ink); }
.cal-weekdays span { padding: 8px 6px; font-size: 12px; color: var(--cal-sub); letter-spacing: .04em; }
.cal-weekdays .is-sunday, .cal-cell.is-sunday > b { color: var(--cal-red); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 7px 7px 8px; border: 0; border-bottom: 1px solid var(--cal-line); border-right: 1px solid var(--cal-line); background: transparent; color: var(--cal-ink); text-align: left; font-size: 14px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell > b { font-weight: 400; font-size: 15px; align-self: flex-start; line-height: 1.3; }
.cal-cell.is-today > b { border-bottom: 2px solid var(--cal-red); }
.cal-cell.is-selected { background: #ece8df; }
.cal-cell.is-muted, .cal-cell.is-muted > b { color: #c6c1b7; }
.cal-entry { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12.5px; line-height: 1.35; }
.cal-entry i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--cal-ink); }
.cal-entry.delivery i { background: transparent; border: 1.5px solid var(--cal-ink); }
.cal-entry.note i { width: 8px; height: 2px; border-radius: 0; background: var(--cal-sub); }
.cal-entry.note, .cal-entry.delivery { color: #5d5850; }
.cal-entry.is-unpaid em { color: var(--cal-red); }
.cal-entry time { flex: 0 0 auto; color: var(--cal-sub); font-variant-numeric: tabular-nums; }
.cal-entry em { min-width: 0; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: 11px; color: var(--cal-sub); }
.cal-legend { display: flex; gap: 16px; padding: 10px 2px; font-size: 12px; color: var(--cal-sub); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.mark-job { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cal-ink); }
.mark-delivery { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--cal-ink); }
.mark-note { display: inline-block; width: 9px; height: 2px; background: var(--cal-sub); }
.cal-day { margin-top: 18px; }
.cal-day h3 { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--cal-ink); font: 600 20px/1.3 var(--sans); color: var(--cal-ink); }
.cal-day h3 span { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--cal-red); }
.cal-row { width: 100%; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--cal-line); background: none; text-align: left; color: var(--cal-ink); }
.cal-row-time { color: var(--cal-sub); font-size: 15px; font-variant-numeric: tabular-nums; }
.cal-row-body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.4; }
.cal-row-body small { display: block; margin-top: 3px; color: var(--cal-sub); font-size: 14px; line-height: 1.45; }
.cal-row-body .cal-org-memo::before { content: "기관 메모: "; }
.cal-status { font-size: 12px; font-weight: 400; color: var(--cal-sub); margin-left: 4px; }
.cal-row .is-unpaid, .cal-row-body small.is-unpaid { color: var(--cal-red); }
.cal-empty { padding: 18px 0; color: var(--cal-sub); font-size: 15px; }
.cal-fab { position: fixed; right: 28px; bottom: 28px; z-index: 11; width: 58px; height: 58px; border: 0; border-radius: 50%; background: #26231f; color: #fff; font-size: 30px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* 메모 쓰기 칸 */
.note-sheet { width: min(460px, 100vw); max-height: 92vh; padding: 0; border: 0; border-top: 1px solid var(--cal-line); background: #fff; color: var(--cal-ink); }
.note-sheet::backdrop { background: rgba(38,35,31,.35); }
.note-sheet-form { display: grid; gap: 12px; padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); }
.note-sheet-head { display: flex; justify-content: space-between; align-items: center; }
.note-sheet-head h3 { margin: 0; font: 600 19px var(--sans); }
.note-kind { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--cal-ink); }
.sheet-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.note-kind input, .sheet-pick input { position: absolute; opacity: 0; pointer-events: none; }
.note-kind span { display: block; padding: 11px 0; text-align: center; font-size: 15px; }
.note-kind label + label span { border-left: 1px solid var(--cal-ink); }
.note-kind input:checked + span { background: var(--cal-ink); color: #fff; }
.sheet-pick span { display: block; padding: 9px 0; text-align: center; border: 1px solid var(--cal-line); font-size: 15px; }
.sheet-pick input:checked + span { border-color: var(--cal-ink); font-weight: 600; }
.sheet-field { display: grid; gap: 6px; }
.sheet-field.is-hidden { display: none; }
.sheet-field > span { font-size: 13px; color: var(--cal-sub); }
.sheet-field > span em { font-style: normal; margin-left: 4px; }
.sheet-field input:not([type="radio"]):not([type="checkbox"]), .sheet-field textarea { width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--cal-ink); border-radius: 0; background: transparent; color: var(--cal-ink); font-size: 17px; }
.sheet-field textarea { border: 1px solid var(--cal-line); padding: 10px; font-size: 16px; resize: vertical; }
.sheet-check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.sheet-check input { width: 20px; height: 20px; accent-color: #26231f; }
.sheet-actions { display: flex; gap: 8px; margin-top: 6px; }
.sheet-actions #save-calendar-note { flex: 1; }
.sheet-button { height: 50px; padding: 0 16px; border: 1px solid var(--cal-ink); background: var(--cal-ink); color: #fff; font-size: 16px; }
.sheet-button.ghost { background: transparent; color: var(--cal-ink); border-color: var(--cal-line); }
.sheet-button[hidden] { display: none; }

@media (max-width: 800px) {
  .app-shell[data-view="calendar"] .workspace { padding-top: 0; }
  .cal-board { display: flex; flex-direction: column; gap: 0; }
  .cal-side { display: contents; }
  .cal-month { order: 1; padding-top: 16px; }
  .cal-main { order: 2; }
  .cal-month-memo { order: 3; margin: 8px 0 24px; }
  .cal-month-memo { width: 100%; }
  .cal-memo-lines li:empty ~ li:empty ~ li:empty { display: none; }
  .cal-month { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 10px; margin-bottom: 10px; }
  .cal-month strong { font-size: 58px; letter-spacing: -2px; }
  .cal-month span { margin: 0 0 6px; font-size: 13px; }
  .cal-arrows { margin: 0 0 4px; }
  .cal-arrow { min-width: 38px; height: 38px; }
  .cal-weekdays span { padding: 6px 3px; font-size: 11px; }
  .cal-cell { min-height: 66px; padding: 4px 3px 5px; gap: 2px; border-right: 0; }
  .cal-cell > b { font-size: 15px; }
  .cal-entry { gap: 2px; font-size: 10.5px; line-height: 1.25; }
  .cal-entry time { display: none; }
  .cal-entry i { width: 5px; height: 5px; }
  .cal-entry.note i { width: 6px; }
  .cal-cell .cal-entry:nth-of-type(3) { display: none; }
  .cal-more { font-size: 10px; }
  .cal-day { scroll-margin-top: 8px; padding-bottom: 20px; }
  .cal-fab { right: 18px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .note-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; }
  .mobile-nav { height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #f7f5f0; }
  .mobile-nav button { font-size: 12px; }
  .mobile-nav button.is-active { color: #26231f; }
}

/* ===== 1-2단계 (2026-11-27): 기관 관리대장 ===== */
#view-orgs { --cal-ink: #26231f; --cal-sub: #8a847a; --cal-line: #dcd7cd; --cal-red: #c23f2c; color: var(--cal-ink); }
.app-shell[data-view="orgs"] .workspace { background: #f7f5f0; }
.org-board { max-width: 860px; }
.org-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--cal-ink); }
.org-head h3 { margin: 0; font: 600 22px var(--sans); }
.org-head p { margin: 0; color: var(--cal-sub); font-size: 14px; }
.org-search { width: 100%; margin: 14px 0 10px; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--cal-line); background: transparent; font-size: 17px; color: var(--cal-ink); }
.org-search:focus { outline: none; border-bottom-color: var(--cal-ink); }
.org-sort { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.org-sort button { padding: 7px 12px; border: 1px solid var(--cal-line); background: transparent; color: var(--cal-sub); font-size: 14px; border-radius: 2px; }
.org-sort button.is-active { border-color: var(--cal-ink); color: var(--cal-ink); font-weight: 600; }
.org-section:empty { display: none; }
.org-section { margin: 6px 0 18px; }
.org-section h4, .org-sub { margin: 14px 0 6px; font: 600 16px var(--sans); }
.org-section h4 span { margin-left: 6px; font-weight: 400; font-size: 13px; color: var(--cal-sub); }
.org-chip { display: block; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--cal-line); background: none; text-align: left; color: var(--cal-ink); }
.org-chip b { font-size: 16px; }
.org-chip small { display: block; margin-top: 2px; color: var(--cal-sub); font-size: 13px; }
.org-merge { border: 1px solid var(--cal-line); padding: 4px 12px; margin-bottom: 8px; }
.org-merge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.org-merge-row + .org-merge-row { border-top: 1px solid var(--cal-line); }
.org-merge-row small { display: block; color: var(--cal-sub); font-size: 13px; }
.org-merge-row .sheet-button { height: 40px; font-size: 14px; flex: 0 0 auto; }
.org-list { list-style: none; margin: 0; padding: 0; }
.org-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--cal-line); background: none; text-align: left; color: var(--cal-ink); }
.org-rank { width: 26px; color: var(--cal-sub); font-size: 15px; font-variant-numeric: tabular-nums; }
.org-row-body b { display: block; font-size: 17px; font-weight: 600; }
.org-row-body small, .org-row-money small { display: block; margin-top: 3px; color: var(--cal-sub); font-size: 13px; }
.org-row-money { text-align: right; font-variant-numeric: tabular-nums; }
.org-row-money b { font-size: 15px; font-weight: 500; }
.org-row .is-unpaid, .org-facts .is-unpaid, .cal-row-body .is-unpaid, .school-history.is-unpaid { color: var(--cal-red, #c23f2c); }
.org-empty { padding: 24px 0; color: var(--cal-sub); }
.org-facts { margin: 4px 0 0; }
.org-facts div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--cal-line); }
.org-facts dt { color: var(--cal-sub); font-size: 14px; }
.org-facts dd { margin: 0; font-size: 15px; }
.org-actions { display: flex; gap: 8px; margin-top: 4px; }
.org-actions #org-new-job { flex: 1; }
.org-sheet { width: min(560px, 100vw); }
.school-history { display: block; min-height: 1em; margin-top: 4px; color: #6e756d; font-size: 12px; font-weight: 500; }
@media (max-width: 800px) {
  .app-shell[data-view="orgs"] .workspace { padding-top: 0; }
  .org-board { padding-top: 18px; }
  .org-head { flex-direction: column; gap: 4px; }
  .mobile-nav { grid-template-columns: repeat(6, 1fr); }
  .mobile-nav button { font-size: 11px; }
  .org-merge-row { flex-direction: column; align-items: stretch; }
  .org-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 88vh; }
}
.app-shell[data-view="orgs"] .topbar { display: none; }
.app-shell[data-view="orgs"] .workspace { padding-top: 34px; }
.org-sheet .cal-row { grid-template-columns: 96px minmax(0, 1fr); }
.org-sheet .cal-empty { padding: 4px 0 8px; margin: 0; }
.org-sheet .org-sub { margin: 10px 0 0; }

/* ===== 2단계 (2026-11-28): 문의함, 길찾기, 알림함, 전달 기간 ===== */
#view-inquiry { --cal-ink: #26231f; --cal-sub: #8a847a; --cal-line: #dcd7cd; --cal-red: #c23f2c; color: var(--cal-ink); }
.app-shell[data-view="inquiry"] .topbar { display: none; }
.app-shell[data-view="inquiry"] .workspace { background: #f7f5f0; padding-top: 34px; }
.inq-paste { margin-top: 14px; }
.inq-paste textarea { min-height: 140px; }
.inq-board .org-actions { margin: 10px 0 4px; }
.inq-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--cal-ink); }
.inq-form.is-hidden { display: none; }
.inq-notice { margin: 0 0 10px; color: var(--cal-sub); font-size: 14px; line-height: 1.5; }
.inq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.inq-grid .inq-wide { grid-column: 1 / -1; }
.inq-grid small { color: var(--cal-sub); font-size: 12px; }
.inq-grid select { width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--cal-ink); background: transparent; font-size: 16px; color: var(--cal-ink); }
.inq-time { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-field.needs-check { background: #fff4c7; padding: 6px 8px; margin: -6px -8px; }
.sheet-field.needs-check > span::after { content: " 확인 필요"; color: #9a6b00; font-weight: 600; }
.inq-check { margin: 12px 0 0; font-size: 15px; font-weight: 600; }
.inq-check.is-unpaid { color: var(--cal-red); }
.inq-item { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--cal-line); }
.inq-buttons { display: flex; gap: 6px; }
.inq-buttons .sheet-button { height: 40px; font-size: 14px; }
.cal-row-tools { display: flex; justify-content: flex-end; margin-top: -8px; padding-bottom: 6px; border-bottom: 1px solid var(--cal-line); }
.cal-row-tools .cal-text-button { font-size: 13px; color: var(--cal-sub); text-decoration: underline; }
.cal-entry.inquiry i { background: transparent; border: 1.5px dashed var(--cal-sub); }
.cal-entry.inquiry { color: var(--cal-sub); }
.cal-bell { position: relative; }
.cal-bell b { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cal-red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.route-sheet, .alert-sheet { --cal-ink: #26231f; --cal-sub: #8a847a; --cal-line: #dcd7cd; --cal-red: #c23f2c; }
.route-place { margin: 0; font-size: 17px; font-weight: 600; }
.route-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.route-note { margin: 0; color: var(--cal-sub); font-size: 12px; }
.alert-sheet .cal-row { grid-template-columns: 84px minmax(0, 1fr); }
.alert-sheet .is-unpaid { color: var(--cal-red); }
.delivery-periods { margin-top: 26px; padding-top: 16px; border-top: 1px solid #e5ddd4; }
.delivery-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee6da; font-size: 14px; }
.delivery-row select { padding: 7px; border: 1px solid #d8cdbd; border-radius: 6px; background: #fffdf8; font-size: 14px; }
@media (max-width: 800px) {
  .app-shell[data-view="inquiry"] .workspace { padding-top: 0; }
  .inq-board { padding-top: 18px; }
  .inq-grid { grid-template-columns: 1fr; }
  .delivery-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ===== 껐다 켜도 로그인 유지: 여는 중 화면 (2026-12-05) ===== */
.boot-view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: #f7f5f0; color: #26231f; text-align: center; }
.boot-view img { width: 96px; height: 96px; object-fit: cover; border-radius: 24px; }
.boot-view p { margin: 0; max-width: 300px; word-break: keep-all; font-size: 16px; line-height: 1.5; color: #5b564e; }
.boot-retry { min-width: 140px; height: 48px; padding: 0 20px; border: 1px solid #26231f; border-radius: 2px; background: #26231f; color: #fff; font-size: 16px; }

/* ===== 1년 달력 창 (2026-12-05) ===== */
.cal-year-open { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cal-month span.cal-year-open::after { content: " ▾"; font-size: .85em; }
.cal-year-open:focus-visible { outline: 2px solid var(--cal-ink); outline-offset: 3px; }
.year-sheet { --cal-ink: #26231f; --cal-sub: #8a847a; --cal-line: #dcd7cd; --cal-red: #c23f2c; width: min(760px, 100vw); }
.year-sheet .note-sheet-form { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.year-sheet .note-sheet-head { position: sticky; top: -18px; z-index: 1; margin: -18px -20px 0; padding: 14px 20px 10px; background: #fff; border-bottom: 1px solid var(--cal-line); }
.year-nav { display: flex; align-items: center; gap: 8px; }
.year-nav h3 { min-width: 86px; text-align: center; }
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.year-month { padding: 6px; border: 1px solid transparent; border-radius: 4px; }
.year-month.is-viewing { border-color: var(--cal-ink); }
.year-month-name { display: block; width: 100%; padding: 4px 2px 6px; border: 0; background: none; color: var(--cal-ink); font: 600 16px var(--sans); text-align: left; }
.year-month.is-this-month .year-month-name { color: var(--cal-red); }
.year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.year-days > span { font-size: 10px; color: var(--cal-sub); padding-bottom: 2px; }
.year-days > span.is-sunday, .year-day.is-sunday { color: var(--cal-red); }
.year-day { position: relative; height: 28px; padding: 0; border: 0; background: none; color: var(--cal-ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.year-day.is-today { font-weight: 700; }
.year-day.is-today::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -12px 0 0 -11px; border: 1.5px solid var(--cal-red); border-radius: 50%; }
.year-day.is-busy::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--cal-ink); }
.year-hint { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 12px; color: var(--cal-sub); }
.year-hint i { display: inline-block; width: 5px; height: 5px; margin: 0 5px 2px 0; border-radius: 50%; background: var(--cal-ink); vertical-align: middle; }
@media (max-width: 800px) {
  .year-sheet { width: 100vw; }
  .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  .year-month { padding: 4px 2px; }
  .year-month-name { font-size: 15px; padding: 6px 2px; }
  .year-days > span { font-size: 9px; }
  .year-day { height: 24px; font-size: 11px; }
  .year-day.is-today::before { width: 19px; height: 19px; margin: -10px 0 0 -9.5px; }
}
