:root {
  --deep: #173d3b;
  --teal: #1f7a70;
  --teal-dark: #145f57;
  --canvas: #f6f4ee;
  --surface: #fffefb;
  --mist: #dceae4;
  --lime: #d9ef82;
  --bound: #f17937;
  --ink: #202624;
  --forest: var(--deep);
  --paper: var(--canvas);
  --white: var(--surface);
  --line: #d8d5cc;
  --muted: #626861;
  --coral: var(--teal);
  --mint: var(--mist);
  --yellow: var(--lime);
  --serif: "Noto Sans KR", sans-serif;
  --sans: "Noto Sans KR", sans-serif;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(23, 61, 59, .08);
}

html { background: var(--canvas); }
body { background: var(--canvas); }
html[data-runtime-mode="live"]:not([data-runtime-ready="true"]) .app-shell { display: none; }
html[data-runtime-mode="live"] .preview-ribbon { display: none; }
html[data-runtime-mode="live"] .app-shell { min-height: 100vh; }
html[data-runtime-mode="live"] .sidebar { top: 0; height: 100vh; }
html[data-runtime-mode="live"] .context-selectors,
html[data-runtime-mode="live"] .sidebar-bottom,
html[data-runtime-mode="live"] .main-nav button > span { display: none; }
html[data-runtime-mode="live"] body[data-role="master"] .context-selectors { display: flex; }
html[data-runtime-mode="live"] body[data-role="master"] .context-selectors label:last-of-type,
html[data-runtime-mode="live"] body[data-role="master"] .context-divider { display: none; }
html[data-runtime-mode="live"] .view .eyebrow { display: none; }
html[data-runtime-mode="live"] .login-preview.open { grid-template-columns: minmax(0, 640px); justify-content: center; }
html[data-runtime-mode="live"] .login-visual { display: none; }
body.runtime-auth-required .close-login { display: none; }
button, input, select, textarea { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.preview-ribbon { background: var(--ink); color: #dce7e2; }
.preview-ribbon span { color: var(--lime); }
.preview-ribbon[data-state="connected"] { background: var(--deep); }
.preview-ribbon[data-state="error"] { background: #8f352c; }

@media (max-width: 680px) {
  html[data-runtime-mode="live"] body[data-role="master"] .context-selectors label:first-child { display: block; }
}

.sidebar { width: auto; background: var(--deep); padding: 24px 18px; }
.brand-mark { display: none; }
.brand-lockup { min-height: 45px; }
.brand-lockup strong { font-size: 18px; letter-spacing: .11em; }
.brand-lockup span { margin-top: 6px; color: #a8beb8; font-size: 9px; }
.facility-card { margin-top: 25px; border-radius: var(--radius); background: rgba(255,255,255,.035); }
.facility-card strong { font-family: var(--sans); font-size: 16px; }
.main-nav { gap: 2px; overflow-y: auto; padding-right: 2px; }
.main-nav button { min-height: 44px; padding: 10px 12px; border-radius: 7px; color: #a9bcb6; font-size: 12px; }
.main-nav button span { color: #789089; }
.main-nav button:hover, .main-nav button.active { background: rgba(217, 239, 130, .1); color: white; }
.main-nav button.active:after { top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--lime); }
.main-nav button i { background: var(--lime); color: var(--deep); }
.telshare-nav b { background: var(--lime); color: var(--deep); }

.topbar { height: 72px; background: rgba(246,244,238,.94); padding-inline: 30px; }
.context-selectors label span, .user-chip small { font-size: 11px; }
.context-selectors select { min-height: 44px; color: var(--ink); font-size: 12px; }
.user-chip > span { background: var(--mist); color: var(--deep); font-family: var(--sans); }
.telshare-header-cta { min-height: 44px; border-color: var(--deep); background: var(--deep); color: white; }
.telshare-header-cta span { color: var(--lime); }
.live-logout-button { min-height: 44px; border: 0; border-bottom: 1px solid var(--deep); background: transparent; color: var(--deep); font-size: 11px; font-weight: 700; }
.telshare-nav { border-color: rgba(217, 239, 130, .38) !important; color: white !important; }

.view { padding: 36px 34px 64px; }
.page-intro { margin-bottom: 20px; }
.page-intro h1 { font: 800 clamp(28px, 3vw, 42px)/1.24 var(--sans); letter-spacing: -.045em; }
.page-intro p:not(.eyebrow) { font-size: 13px; line-height: 1.65; }
.eyebrow, .eyebrow.dark { color: var(--teal-dark); font-size: 10px; letter-spacing: .17em; }
.outline-button, .primary-button { min-height: 44px; border-radius: 7px; font-size: 12px; }
.primary-button { border-color: var(--teal); background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }

.role-priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.role-priority-card {
  position: relative;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  text-align: left;
  overflow: hidden;
}
.role-priority-card > span { grid-column: 1 / -1; color: var(--lime); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.role-priority-card > small { margin-top: 22px; font-size: 12px; font-weight: 700; }
.role-priority-card > strong { grid-column: 1; margin-top: 5px; font-size: clamp(27px, 3vw, 42px); letter-spacing: -.045em; }
.role-priority-card > p { grid-column: 1; margin: 9px 0 0; color: #afc3bd; font-size: 12px; }
.role-priority-card > i { grid-column: 2; grid-row: 2 / 5; align-self: end; font-size: 11px; font-style: normal; }
.role-priority-card--deep { border-color: var(--deep); background: var(--deep); color: white; }
.role-priority-card--mist { background: var(--mist); color: var(--deep); }
.role-priority-card--mist > span { color: var(--teal-dark); }
.role-priority-card--mist > p { color: #4c6961; }

.role-quick-actions {
  margin-bottom: 18px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.role-quick-actions > header { margin-bottom: 12px; }
.role-quick-actions > header span { color: var(--teal-dark); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.role-quick-actions > header h2 { margin: 0; font-size: 16px; }
.role-quick-actions > header small { color: var(--muted); font-size: 11px; }
.role-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.role-quick-action {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  text-align: left;
}
.role-quick-action > span { color: var(--teal-dark); font-size: 9px; font-weight: 800; }
.role-quick-action > strong { font-size: 13px; }
.role-quick-action > small { grid-column: 2; color: var(--muted); font-size: 10px; }
.role-quick-action > i { grid-column: 2; align-self: center; font-style: normal; }
.role-quick-action.is-emphasis { border-color: var(--teal); background: var(--teal); color: white; }
.role-quick-action.is-emphasis > span, .role-quick-action.is-emphasis > small { color: white; }

.notice-strip { border-top-color: var(--deep); }
.notice-strip > span { background: var(--lime); color: var(--deep); }
.metric-grid { gap: 10px; }
.metric, .panel, .issue-workspace, .settlement-hero, .room-filters select, .search-field { border-radius: var(--radius); }
.metric--ink, .settlement-hero { background: var(--deep); }
.metric strong, .settlement-hero > div > strong, .panel-heading h2, .month-control strong { font-family: var(--sans); }
.metric b, .formula .result strong { color: var(--lime); }
.mini-bars .accent, .airbnb, .table-dot.coral { background: var(--teal); }
.booking { background: #dceae4; border-color: var(--teal); }
.direct-booking { background: #edf1d7; border-color: #839449; }
.status { font-size: 10px; }
.feedback { background: #f7e4d6; color: #8c421e; }
.progress { background: #f2e9ba; color: #685816; }
.booked, .active-status { background: var(--mist); color: var(--deep); }

.assigned-room-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.assigned-room-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.assigned-room-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.assigned-room-card header span { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.assigned-room-card header em { padding: 4px 8px; border-radius: 999px; background: var(--mist); color: var(--deep); font-size: 10px; font-style: normal; }
.assigned-room-card h2 { margin: 12px 0 5px; font-size: 27px; }
.assigned-room-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.assigned-room-card dl { margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.assigned-room-card dl div { padding-top: 9px; border-top: 1px solid var(--line); }
.assigned-room-card dt { color: var(--muted); font-size: 10px; }
.assigned-room-card dd { margin: 5px 0 0; font-size: 12px; font-weight: 700; }
.assigned-room-notice { margin-bottom: 12px; padding: 13px 15px; border-left: 3px solid var(--teal); background: var(--mist); color: #365b52; font-size: 12px; line-height: 1.6; }

.login-visual { background: var(--deep); }
.login-visual h1 { font-family: var(--sans); font-weight: 800; }
.login-proof strong { color: var(--lime); font-family: var(--sans); }
.login-role-tabs { grid-template-columns: repeat(4, 1fr); }
.login-role-tabs .active:after { background: var(--teal); }
.login-form-side { background: var(--surface); }
.chat-launcher { background: var(--deep); }
.chat-launcher > span, .chat-panel header > div > span { background: var(--lime); color: var(--deep); }

@media (max-width: 1100px) {
  .role-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .preview-ribbon { min-height: 24px; height: auto; padding: 5px 8px; }
  .topbar { height: 62px; padding-inline: 13px; }
  .view { padding: 24px 12px 86px; }
  .page-intro { margin-bottom: 15px; }
  .page-intro h1 { font-size: 25px; }
  .role-priority-grid { grid-template-columns: 1fr; gap: 6px; }
  .role-priority-card { min-height: 134px; padding: 16px; }
  .role-priority-card > small { margin-top: 12px; }
  .role-priority-card > strong { font-size: 29px; }
  .role-quick-actions { padding: 14px 12px; }
  .role-quick-actions > header small { display: none; }
  .role-quick-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .role-quick-action { min-height: 64px; padding: 9px; }
  .role-quick-action > small { display: none; }
  .role-quick-action > strong { font-size: 12px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric--ink { min-height: 140px; }
  .metric--ink strong { margin-top: 16px; }
  .assigned-room-grid { grid-template-columns: 1fr; }
  .assigned-room-card { padding: 16px; }
  .mobile-nav { height: 64px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top-color: var(--line); }
  .mobile-nav button { min-height: 52px; color: var(--muted); font-size: 11px; }
  .mobile-nav button.active { color: var(--teal); }
  .chat-launcher { display: flex; right: 12px; bottom: 76px; }
  .chat-launcher b { display: none; }
  body[data-role="owner"] #settlementView .page-intro.compact,
  body[data-role="owner"] #contractView .page-intro.compact { display: grid; grid-template-columns: 1fr; gap: 12px; }
  body[data-role="owner"] #settlementView .month-control { width: 100%; justify-content: space-between; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
  body[data-role="owner"] #settlementView .month-control strong { white-space: nowrap; }
  body[data-role="owner"] #contractView .scope-chip { width: max-content; white-space: nowrap; }
  body[data-role="owner"] #settlementView .settlement-hero > div > strong,
  body[data-role="owner"] #contractView .settlement-hero > div > strong { font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
  body[data-role="owner"] #settlementView .formula,
  body[data-role="owner"] #contractView .formula { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body[data-role="owner"] #settlementView .formula .result,
  body[data-role="owner"] #contractView .formula .result { padding-left: 0; border-left: 0; }
  body[data-role="owner"] #settlementView .data-table,
  body[data-role="owner"] #contractView .data-table { display: grid; gap: 7px; padding: 0 10px 10px; overflow: visible; }
  body[data-role="owner"] #settlementView .table-head,
  body[data-role="owner"] #contractView .table-head { display: none; }
  body[data-role="owner"] #settlementView .table-row:not(.table-head),
  body[data-role="owner"] #contractView .table-row:not(.table-head) { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
  body[data-role="owner"] #settlementView .table-row:not(.table-head) { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
  body[data-role="owner"] #settlementView .table-row:not(.table-head) > :nth-child(2) { grid-column: 1; color: var(--muted); }
  body[data-role="owner"] #settlementView .table-row:not(.table-head) > :nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  body[data-role="owner"] #settlementView .table-row:not(.table-head) > :nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
  body[data-role="owner"] #contractView .table-row:not(.table-head) { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; }
  body[data-role="owner"] #contractView .table-row:not(.table-head) > span { overflow-wrap: anywhere; }
  .login-preview.open { display: block; overflow-y: auto; }
  .login-visual { min-height: 190px; padding: 38px 24px 24px; }
  .login-form-side { padding: 28px 20px 50px; }
  .login-role-tabs { grid-template-columns: repeat(2, 1fr); }
  .login-role-tabs button { min-height: 44px; font-size: 11px; }
}
