:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #13213a; background: #f7f9fc; font-size: 14px;
  --teal: #00949c; --teal-dark: #007b83; --border: #e4eaf2; --muted: #71809a;
}
* { box-sizing: border-box; }
body { margin: 0; }
button,input,select,textarea { font: inherit; }
button,a,input,select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: #007e91; text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible,a:focus-visible { outline: 3px solid #79d4d9; outline-offset: 3px; }
input,select,textarea { color: #22314b; background: #fff; border: 1px solid #dbe3ee; border-radius: 8px; padding: 11px 12px; min-width: 0; }
input:focus,select:focus,textarea:focus { outline: 2px solid #68c9d0; outline-offset: 1px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--teal); padding: 0; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: #35445e; }
label small { font-weight: 400; }
small { font-size: 11px; }
.hidden { display: none !important; }
.icon { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; }
.brand { display: flex; align-items: center; gap: 10px; color: #101b32; font-size: 26px; letter-spacing: -.9px; text-decoration: none !important; }
.brand-arrow { font-size: 42px; color: var(--teal); font-weight: 800; line-height: 1; }
.boot { padding: 15vh 10vw; }
.boot p { color: var(--muted); }
.workspace { display: flex; min-height: 100vh; }
.sidebar { width: 235px; min-width: 235px; padding: 27px 14px 18px; border-right: 1px solid var(--border); background: #fcfdff; position: fixed; top: 0; bottom: 0; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 0 11px; }
.sidebar-label { font-size: 9px; color: #9aa5b8; letter-spacing: 1.25px; font-weight: 700; margin: 44px 14px 14px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 14px; color: #344661; padding: 13px 14px; border: 0; background: transparent; border-radius: 9px; text-align: left; font-weight: 500; margin: 3px 0; white-space: nowrap; }
.nav-item .icon { color: #687b95; width: 21px; height: 21px; }
.nav-item.active { background: #e6f6f7; color: #00868f; font-weight: 700; }
.nav-item.active .icon { color: #0098a2; }
.nav-item:hover { background: #eef4f8; }
.sidebar-bottom { margin-top: auto; }
.profile { border: 0; background: none; width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 10px; text-align: left; color: #3b4d67; }
.avatar { width: 35px; height: 35px; border-radius: 50%; background: #e5ecf4; color: #5d7793; display: inline-grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.main-shell { flex: 1; min-width: 0; margin-left: 235px; }
.topbar { height: 63px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; font-size: 12px; }
.topbar-label { color: #8c99ad; }
.topbar-right { display: flex; gap: 16px; align-items: center; }
#main { max-width: 1720px; margin: auto; padding: 30px 32px 65px; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 2px 0 25px; }
.page-heading h1 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.8px; font-weight: 720; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.heading-actions { display: flex; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; border: 1px solid var(--border); padding: 10px 15px; min-height: 40px; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.button.primary { background: var(--teal); color: white; border-color: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: white; color: #34445f; }
.button.secondary:hover { border-color: #a8c4d2; background: #fbfdff; }
.button.danger { background: #fff3f2; color: #b5443c; border-color: #f4d5d2; }
.button.small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.icon-button { display: inline-grid; place-items: center; border: 0; background: none; width: 32px; height: 32px; padding: 5px; border-radius: 6px; color: #7b8ba3; }
.icon-button:hover { background: #edf4f6; color: #007f8b; }
.quiet { color: var(--muted); font-weight: 400; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 23px; margin-bottom: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 8px; letter-spacing: -.3px; }
.panel p { color: var(--muted); line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 23px; }
.stat { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 20px; display: flex; align-items: center; gap: 15px; }
.stat-icon { width: 46px; height: 46px; border-radius: 50%; background: #eaf8f8; color: var(--teal); display: grid; place-items: center; }
.stat-icon .icon { width: 24px; height: 24px; }
.stat .quiet { font-size: 12px; display: block; margin-bottom: 5px; }
.stat strong { display: block; font-size: 27px; font-weight: 700; }
.notice { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #d9eded; background: #eef9f9; color: #377581; border-radius: 9px; padding: 14px 16px; font-size: 12px; line-height: 1.6; margin: 15px 0; }
.notice.amber { background: #fff8e9; border-color: #f6e5bf; color: #997026; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 17px; }
.toolbar input { flex: 1; min-width: 180px; }
.toolbar select { max-width: 220px; font-size: 12px; }
.table-card { background: white; border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #7c8aa0; font-size: 11px; font-weight: 500; background: #fbfcfe; padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { font-size: 12px; padding: 16px; border-bottom: 1px solid #edf1f6; vertical-align: middle; line-height: 1.5; }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: #8592a7; line-height: 1.5; margin-top: 2px; }
td strong { color: #26364f; font-weight: 650; }
tbody tr:hover { background: #fcfdff; }
.table-title { font-weight: 600; color: #243951; font-size: 13px; }
.table-link { background: none; border: 0; padding: 0; color: #008995; text-align: left; font-weight: 600; }
.actions { display: flex; align-items: center; gap: 4px; }
.nowrap { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 5px 8px; font-size: 10px; line-height: 1.3; font-weight: 500; white-space: nowrap; background: #f1f4f8; color: #76869c; }
.dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
.badge.green { background: #eaf9ef; color: #1a9953; }
.badge.amber { background: #fff4df; color: #c0801b; }
.badge.blue { background: #eaf4ff; color: #328cd9; }
.badge.red { background: #fff0ee; color: #c25d54; }
.badge.teal { background: #e6f8f7; color: #008d96; }
.empty { padding: 65px 25px; text-align: center; background: white; }
.empty-icon { display: inline-grid; place-items: center; width: 55px; height: 55px; border-radius: 14px; color: var(--teal); background: #e9f8f8; }
.empty h3 { font-size: 16px; margin: 18px 0 6px; }
.empty p { color: var(--muted); line-height: 1.7; max-width: 450px; margin: 0 auto 20px; font-size: 12px; }
.skeleton { padding: 55px; text-align: center; color: var(--muted); }
.error-panel { padding: 25px; background: #fff5f2; border: 1px solid #f2d9d1; border-radius: 10px; color: #ad5a47; }
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: grid; gap: 10px; max-width: 450px; }
.toast { padding: 15px 20px; border: 1px solid #cce8e5; background: #f1fffc; color: #2a766b; border-radius: 10px; box-shadow: 0 8px 30px #19335318; font-size: 12px; line-height: 1.7; }
.toast.error { background: #fff5f2; color: #ae574a; border-color: #efd6cf; }
dialog { width: min(94vw,520px); border: 1px solid var(--border); border-radius: 14px; padding: 32px; color: #1f304c; box-shadow: 0 20px 70px #152a3f25; }
dialog::backdrop { background: #16304b45; }
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; max-height: 100vh; height: 100vh; width: min(94vw,490px); border-radius: 0; padding: 35px 30px; }
.modal-close { position: absolute; top: 17px; right: 17px; }
dialog h2 { margin: 0 25px 7px 0; font-size: 23px; letter-spacing: -.6px; }
dialog p { color: var(--muted); line-height: 1.7; font-size: 12px; }
dialog form { display: grid; gap: 19px; margin-top: 23px; }
dialog form .button.primary { margin-top: 5px; }
.form-error { border: 1px solid #f1d8d4; border-radius: 7px; padding: 10px 12px; background: #fff5f2; color: #ab584a; font-size: 12px; line-height: 1.6; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 10px; }
.secret-input { display: flex; border: 1px solid #dbe3ee; border-radius: 8px; align-items: center; }
.secret-input input { border: 0; flex: 1; width: 100%; }
.secret-input button { border: 0; background: none; color: #72839b; padding: 10px; }
.steps-instructions { display: grid; gap: 12px; padding: 18px 0; font-size: 12px; color: #687b93; }
.steps-instructions div { display: flex; align-items: center; gap: 10px; }
.step-number { width: 26px; height: 26px; border-radius: 50%; background: #eef4f8; display: inline-grid; place-items: center; color: #6f8198; flex-shrink: 0; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-story { padding: 9vh 6vw; background: #edf7f8; display: flex; flex-direction: column; }
.auth-story h1 { font-size: clamp(30px,3.3vw,52px); letter-spacing: -1.7px; line-height: 1.17; max-width: 530px; margin: 10vh 0 22px; }
.auth-story p { color: #617e8b; max-width: 450px; font-size: 15px; line-height: 1.8; }
.auth-points { display: grid; gap: 16px; margin-top: 20px; color: #407b82; font-size: 13px; }
.auth-points span { display: flex; gap: 12px; align-items: center; }
.auth-form-area { background: #fff; display: grid; place-items: center; padding: 40px; }
.auth-card { max-width: 370px; width: 100%; }
.auth-card h2 { font-size: 28px; letter-spacing: -.8px; margin: 0 0 10px; }
.auth-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-card form { display: grid; gap: 20px; margin-top: 27px; }
.auth-toggle { background: none; border: 0; padding: 0; color: #008d97; font-weight: 600; font-size: 12px; }
.auth-foot { margin-top: 24px; text-align: center; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; line-height: 1.6; }
.check-row input { margin-top: 2px; flex-shrink: 0; }
.schedule-scroll { overflow-x: auto; padding-bottom: 8px; }
.week-schedule { display: grid; grid-template-columns: 29px repeat(24,minmax(18px,1fr)); gap: 3px; min-width: 580px; margin: 20px 0 10px; user-select: none; touch-action: pan-y; }
.week-schedule .hour,.week-schedule .day { font-size: 10px; color: #7e8ca1; text-align: center; align-self: center; }
.week-schedule .day { text-align: left; }
.slot { height: 22px; padding: 0; border: 0; border-radius: 3px; background: #e5ebf2; }
.slot.active { background: #11afb2; }
.slot.hold { background: #f1f3f6; border: 1px dashed #c6d0de; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 11px; color: #8896ab; padding: 17px 4px; }
.pagination .actions { gap: 8px; }
.event-icon { width: 29px; height: 29px; border-radius: 50%; background: #eaf8f5; color: #129676; display: inline-grid; place-items: center; }
.event-icon.decrease { background: #fff0f1; color: #df6479; }
.event-icon.blocked,.event-icon.limit { background: #fff5e8; color: #d79431; }
.event-icon.schedule { background: #ecf2fe; color: #5c8bda; }
.event-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 265px; }
.history-table td { padding: 12px 13px; font-size: 11px; }
.history-table .reason { color: #7a8ca7; max-width: 380px; }
.history-table td:last-child { min-width: 105px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 25px; }
.details-grid small { display: block; color: #8191a7; margin-bottom: 5px; }
.mini-check { display: inline-flex; align-items: center; gap: 5px; color: #7f8da4; }
.link-button { border: 0; background: none; padding: 0; color: #008a95; text-align: left; }
.note-list { color: #71849c; font-size: 12px; line-height: 1.8; }
@media(max-width:1150px) {
  .sidebar { width: 205px; min-width: 205px; }
  .main-shell { margin-left: 205px; }
  #main { padding: 24px 22px 50px; }
  .stats { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:800px) {
  .sidebar { width: 68px; min-width: 68px; padding: 21px 9px; }
  .sidebar .brand b,.sidebar-label,.nav-item>span,.profile>span:not(.avatar) { display: none; }
  .sidebar .brand { padding: 0 5px; }
  .sidebar nav { margin-top: 35px; }
  .nav-item { padding: 12px; }
  .main-shell { margin-left: 68px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .topbar { padding: 0 20px; }
  .topbar-label { display: none; }
  .topbar-right { margin-left: auto; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { padding: 25px; }
  .auth-story h1,.auth-story>p,.auth-points { display: none; }
  .auth-form-area { padding: 35px 25px 70px; }
}
@media(max-width:500px) {
  #main { padding: 22px 14px 45px; }
  .stats { gap: 8px; }
  .stat { padding: 13px; gap: 9px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat strong { font-size: 22px; }
  .page-heading h1 { font-size: 24px; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .heading-actions .button { flex: 1; font-size: 11px; }
  .panel { padding: 18px; }
  .field-grid,.mode-grid { grid-template-columns: 1fr; gap: 15px; }
  dialog.drawer { width: 100vw; padding: 28px 22px; }
}

/* One-page strategy workspace. Hour colours are repeated in the legend and labels. */
.strategy-identity { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 18px; }
.identity-fields { display: grid; grid-template-columns: minmax(220px,1.3fr) minmax(180px,1fr); gap: 20px; flex: 1; }
.strategy-live { display: grid; gap: 12px; min-width: 190px; }
.strategy-live>span { font-size: 20px; font-weight: 700; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.section-heading h2 { margin: 0; }
.section-heading>label { min-width: 210px; font-size: 11px; }
.section-heading p { margin: 8px 0 0; }
.listing-picker { margin-bottom: 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.tab { border: 0; border-radius: 8px; background: transparent; color: #63768e; padding: 11px 16px; font-weight: 600; }
.tab.selected { color: #007e87; background: #e6f6f7; }
.tab b { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 6px; background: #d4eeee; }
.save-status { color: #70839b; font-size: 11px; margin: 15px 0 0; line-height: 1.7; }
#listing-picker-body { margin-top: 15px; }
.schedule-panel { margin-bottom: 18px; }
.rule-palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 16px; }
.rule-chip { border: 1px solid currentColor; border-radius: 8px; padding: 11px 16px; font-size: 12px; background: #fff; font-weight: 600; }
.rule-chip.minimum,.rule-key.minimum { color: #697b94; background: #f1f4f8; }
.rule-chip.fixed,.rule-key.fixed { color: #068698; background: #e8f9fc; }
.rule-chip.top3,.rule-key.top3 { color: #c34068; background: #fff0f5; }
.rule-chip.top10,.rule-key.top10 { color: #b26813; background: #fff3df; }
.rule-chip.page,.rule-key.page { color: #3f76b5; background: #edf5ff; }
.rule-chip.range,.rule-key.range { color: #557c22; background: #f0f8e7; }
.rule-chip.hold,.rule-key.hold { color: #85909f; background: #f6f7fa; }
.rule-chip.quality,.rule-key.quality { color: #7f63be; background: #f5f0ff; }
.rule-chip.selected { box-shadow: 0 0 0 2px #fff,0 0 0 4px currentColor; }
.hour-rule-settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; background: #f8fafc; border: 1px solid var(--border); padding: 17px; border-radius: 9px; min-height: 94px; }
.hour-rule-settings label { font-size: 11px; width: 185px; }
.hour-rule-settings>.quiet { align-self: center; max-width: 280px; font-size: 12px; line-height: 1.7; }
.selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 20px 0 12px; font-size: 11px; color: #7c8da4; }
.selection-toolbar .button { font-size: 11px; padding: 7px 10px; }
.selection-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; padding: 10px 0; }
.selection-detail { display: block; color: #7789a0; line-height: 1.7; margin-top: 6px; }
.hourly-grid { grid-template-columns: 30px repeat(24,minmax(32px,1fr)); min-width: 930px; gap: 4px; }
.hourly-grid .hour,.hourly-grid .day { border: 0; background: none; padding: 5px 0; color: #64768e; }
.hourly-grid .day { font-weight: 650; }
.hourly-grid .slot { height: 36px; font-size: 9px; white-space: nowrap; border: 1px solid transparent; line-height: 1; }
.hourly-grid .slot.minimum { background: #edf1f6; color: #6c7c94; }
.hourly-grid .slot.fixed { background: #c8edf3; color: #126d7c; }
.hourly-grid .slot.top3 { background: #fbd7e4; color: #9d3154; }
.hourly-grid .slot.top10 { background: #fce1b8; color: #965c10; }
.hourly-grid .slot.page { background: #d4e6fb; color: #32689f; }
.hourly-grid .slot.range { background: #dcebc8; color: #547723; }
.hourly-grid .slot.quality { background: #e4d9f7; color: #7356ac; }
.hourly-grid .slot.hold { background: #fafbfc; color: #9ba7b6; border: 1px dashed #d5dde7; }
.hourly-grid .slot.chosen { outline: 2px solid #1d576a; outline-offset: -2px; box-shadow: inset 0 0 0 3px #ffffff80; }
.hourly-grid .slot:focus-visible { outline: 3px solid #122b46; outline-offset: 0; }
.schedule-help { color: #75859a; font-size: 11px; line-height: 1.8; margin-top: 8px; }
.hour-legend { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.rule-key { padding: 5px 9px; border-radius: 5px; font-size: 10px; }
.budget-details { margin-top: 18px; }
.budget-details summary { cursor: pointer; font-weight: 650; }
.strategy-savebar { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: space-between; gap: 15px; align-items: center; background: #fffffff5; border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; box-shadow: 0 -5px 20px #19355308; margin: 20px 0; }
.strategy-history .section-heading { margin-bottom: 20px; }
@media(max-width:1150px){ .strategy-identity { align-items: flex-start; } .identity-fields { grid-template-columns: 1fr; } }
@media(max-width:800px){ .strategy-identity,.section-heading { flex-direction: column; align-items: stretch; } .identity-fields { width: 100%; } .strategy-live { grid-template-columns: 1fr 1fr; align-items: center; } .strategy-live small { grid-column: 1/-1; } .section-heading>label { width: 100%; } .rule-chip { padding: 10px 12px; } }
@media(max-width:500px){ .rule-palette { gap: 9px; } .rule-chip { font-size: 11px; } .selection-action,.strategy-savebar { align-items: stretch; flex-direction: column; } .hour-rule-settings label { width: 100%; } .strategy-live { grid-template-columns: 1fr; } .tab { font-size: 11px; padding: 10px; } }
