:root {
  --ink: #182238;
  --muted: #6b7280;
  --line: #dde1eb;
  --canvas: #f8f9fc;
  --card: #ffffff;
  --indigo: #3e46bf;
  --indigo-dark: #2d359d;
  --indigo-soft: #eef0ff;
  --amber: #f5b739;
  --amber-soft: #fff3d9;
  --green: #168344;
  --danger: #bb2f3e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 28px 16px; display: flex; flex-direction: column; gap: 34px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 24px; font-weight: 760; letter-spacing: -.03em; padding: 0 13px; }
.brand-large { justify-content: center; padding: 0; font-size: 31px; }
.brand-mark { color: var(--amber); font-size: 38px; line-height: .7; text-shadow: 0 0 0 var(--amber); }
nav { display: grid; gap: 10px; }
.nav-item { border: 0; border-radius: 10px; text-align: left; display: flex; align-items: center; gap: 13px; background: transparent; color: #4c586e; padding: 14px 16px; font-size: 16px; }
.nav-item:hover { background: #f4f5fa; }
.nav-item.active { background: var(--indigo-soft); color: var(--indigo); font-weight: 650; }
.nav-icon { width: 22px; text-align: center; font-size: 19px; }
.sign-out { margin-top: auto; border: 0; background: transparent; color: var(--muted); text-align: left; padding: 12px 16px; }
.main-content { padding: 38px 42px 70px; max-width: 1540px; width: 100%; min-width: 0; margin: 0 auto; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 7px; font-size: clamp(30px, 3.3vw, 43px); letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 10px rgb(32 41 73 / 5%); padding: 22px; min-width: 0; }
.card h2 { margin: 0 0 18px; font-size: 21px; letter-spacing: -.025em; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.stack > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 650; color: #364157; }
.field small, .helper { color: var(--muted); font-size: 12px; line-height: 1.45; }
input, select, textarea { border: 1px solid #cfd4df; border-radius: 8px; background: #fff; color: var(--ink); padding: 11px 12px; width: 100%; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgb(62 70 191 / 12%); }
textarea { min-height: 90px; line-height: 1.45; resize: vertical; }
.button { border: 1px solid #bec4d2; border-radius: 8px; background: white; color: var(--ink); padding: 10px 15px; font-weight: 650; }
.button:hover { background: #f7f8fb; }
.button-primary { border-color: var(--indigo); background: var(--indigo); color: #fff; }
.button-primary:hover { background: var(--indigo-dark); }
.button-subtle { border-color: transparent; background: transparent; color: var(--indigo); padding-left: 0; padding-right: 0; }
.button-danger { color: var(--danger); border-color: transparent; background: transparent; padding: 7px; }
.button-small { padding: 7px 10px; font-size: 13px; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.sticky-actions { position: sticky; bottom: 0; background: rgb(248 249 252 / 94%); backdrop-filter: blur(9px); margin: 22px -42px -70px; padding: 15px 42px; border-top: 1px solid var(--line); }
.child-tabs { display: flex; gap: 14px; align-items: stretch; margin-bottom: 18px; }
.child-tab { min-width: 220px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 16px; display: flex; gap: 11px; align-items: center; background: #fff; color: var(--ink); text-align: left; }
.child-tab.active { border-color: var(--indigo); background: #f4f4ff; box-shadow: 0 0 0 1px var(--indigo); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 700; background: #7d84e5; }
.avatar.orange { background: #e88957; }
.child-tab strong { font-size: 16px; }
.child-tab .selected { margin-left: auto; color: var(--indigo); font-size: 20px; }
.child-tabs .button { margin-left: auto; align-self: center; }
.tab-strip { display: flex; overflow: auto; border: 1px solid #cfd4df; border-radius: 8px; margin-bottom: 10px; min-width: 0; }
.tab-strip button { border: 0; border-right: 1px solid #cfd4df; background: #fff; padding: 10px 13px; white-space: nowrap; color: #344057; font-size: 13px; }
.tab-strip button:last-child { border-right: 0; }
.tab-strip button.active { color: #fff; background: var(--indigo); font-weight: 650; }
.list-row, .url-row { display: flex; align-items: center; gap: 9px; border: 1px solid #dce0e8; border-radius: 8px; padding: 8px 10px; margin: 7px 0; background: #fff; min-width: 0; }
.list-row { transition: border-color .15s ease, background .15s ease, opacity .15s ease; }
.list-row.dragging { opacity: .5; }
.list-row.drop-target { border-color: var(--indigo); background: var(--indigo-soft); }
.drag { color: #9aa1af; letter-spacing: -3px; cursor: grab; user-select: none; }
.drag:active { cursor: grabbing; }
.list-row input { border: 0; padding: 3px 0; }
.list-row input:focus { box-shadow: none; }
.list-row .row-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-shrink: 0; }
.move-button { border: 0; background: transparent; color: #69758b; border-radius: 5px; padding: 4px 6px; line-height: 1; }
.move-button:hover:not(:disabled) { background: #eef0ff; color: var(--indigo); }
.move-button:disabled { opacity: .3; cursor: default; }
.url-row input { font-size: 13px; min-width: 0; }
.add-row { display: flex; gap: 8px; margin-top: 9px; }
.add-row input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 11px 0; }
.chip { border: 1px solid #f1c873; background: var(--amber-soft); border-radius: 7px; padding: 8px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.prefix-value { white-space: nowrap; }
.chip button { border: 0; background: transparent; color: #936a17; padding: 0; }
.section-rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.schedule-row { display: grid; grid-template-columns: 106px 112px minmax(0, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid #eceef3; padding: 11px 0; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-name { font-weight: 650; }
.time-input { width: 112px; }
.time-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.time-chip { border: 1px solid #cfd4df; background: #fafbfe; border-radius: 7px; padding: 7px 8px; font-size: 12px; display: inline-flex; gap: 8px; align-items: center; }
.time-chip button { border: 0; background: transparent; color: #5c6678; padding: 0; }
.provider-lock { background: #f7f8fb; color: #47536a; }
.status-strip { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }
.status-good { color: var(--green); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.status-good::before { content: "✓"; display: grid; place-items: center; width: 23px; height: 23px; color: white; border-radius: 50%; background: var(--green); }
.editor { min-height: 500px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #17202b; color: #e9eef7; border-color: #17202b; line-height: 1.55; }
.editor-tools { display: flex; justify-content: flex-end; gap: 8px; margin: -9px 0 12px; }
.results { border: 1px solid #d0ead9; background: #fbfffc; }
.result-success { border: 1px solid #cde8d5; background: #effbf2; border-radius: 8px; color: var(--green); padding: 12px; font-weight: 650; }
.count-tile { border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 12px 8px; background: #fff; }
.count-tile strong { display: block; font-size: 23px; color: var(--indigo); margin-top: 3px; }
.result-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.result-table th, .result-table td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; }
.code-ok { color: var(--green); display: flex; gap: 7px; align-items: center; margin-top: 12px; font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 15px; background: #17202b; color: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / 18%); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 5; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #8f2432; }
.login-screen { min-height: 100vh; display: grid; place-items: center; background: var(--canvas); }
.login-card { width: min(420px, calc(100vw - 36px)); padding: 42px; text-align: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 10px 35px rgb(32 41 73 / 9%); }
.login-card p { color: var(--muted); margin: 20px 0 28px; }
.login-card .button { width: 100%; }
.error-box { border: 1px solid #f0c4c9; background: #fff6f6; color: #8f2432; border-radius: 8px; padding: 12px; margin-bottom: 15px; }
@media (max-width: 1050px) { .app-shell { grid-template-columns: 220px minmax(0, 1fr); } .main-content { padding-left: 26px; padding-right: 26px; } .sticky-actions { margin-left: -26px; margin-right: -26px; padding-left: 26px; padding-right: 26px; } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .app-shell { display: block; } .sidebar { position: sticky; top: 0; z-index: 3; padding: 12px; display: block; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar .brand { display: inline-flex; } .sidebar nav { display: inline-flex; margin-left: 10px; vertical-align: middle; } .nav-item { padding: 9px; font-size: 0; } .nav-icon { font-size: 18px; } .sign-out { float: right; padding: 9px; } .main-content { padding: 24px 16px 54px; } .sticky-actions { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } .child-tabs { overflow: auto; } .child-tab { min-width: 180px; } .child-tabs .button { min-width: max-content; } .schedule-row { grid-template-columns: 1fr; gap: 7px; } .time-input { width: 100%; } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
