:root {
  --ink: #16252c;
  --muted: #5b6b72;
  --line: #dde6ea;
  --soft: #f4f8f9;
  --brand: #03445b;
  --brand-2: #24a4c6;
  --danger: #b42318;
  --warn: #d9730d;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: #fff; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.bar { background: var(--brand); color: #fff; }
.bar-in { max-width: 1040px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 16px; }
.mark { font-weight: 700; letter-spacing: .01em; color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.mark small { font-weight: 400; opacity: .75; font-size: 14px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.who button { font: inherit; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.who button:hover { background: rgba(255,255,255,.12); }

main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 24px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.tools { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search { flex: 1 1 260px; max-width: 360px; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.search:focus, .field input:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }

.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { display: block; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.card:hover, .card:focus-visible { border-color: var(--brand-2); box-shadow: 0 2px 10px rgba(3, 68, 91, .08); outline: none; }
.card b { display: block; font-size: 16px; color: var(--brand); }
.card span { color: var(--muted); font-size: 14px; }

.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.rows > .row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.rows > .row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-child { border-top: 0; }
.row-main { flex: 1 1 280px; min-width: 0; }
.row-main b { display: block; font-size: 16px; }
.row-main code { font-size: 13px; color: var(--muted); word-break: break-all; }
.row-actions { display: flex; gap: 8px; }
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: #02364a; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: var(--soft); }
.btn:disabled { opacity: .6; cursor: default; }

.empty, .note { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: var(--soft); }
.error { color: var(--danger); }
.loading { color: var(--muted); }

.signin { max-width: 380px; margin: 56px auto 0; padding: 28px; border: 1px solid var(--line); border-radius: 14px; }
.signin h1 { font-size: 22px; }
.field { display: block; margin: 16px 0 0; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.signin .btn { width: 100%; margin-top: 20px; padding: 10px; }
.signin .error { margin: 12px 0 0; font-size: 14px; }

.dash-groups { display: grid; gap: 16px; }
.when { color: var(--muted); font-size: 13px; }
.tables { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tables .tname { color: var(--ink); font-weight: 600; }
.tables-note { color: #8a4a06; }
.artifact { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.artifact-link { font-weight: 600; }
.artifact-none { font-style: italic; }
.folder > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px; font-weight: 700; font-size: 16px; color: var(--ink); }
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary::before { content: ''; width: 18px; height: 14px; flex: none; border-radius: 2px 3px 3px 3px; background: var(--brand-2); clip-path: polygon(0 0, 40% 0, 50% 18%, 100% 18%, 100% 100%, 0 100%); transition: opacity .15s; }
.folder:not([open]) > summary::before { opacity: .55; }
.folder > summary:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
.folder-count { font-weight: 400; font-size: 13px; color: var(--muted); }
.folder-empty { margin: 0 0 4px 28px; color: var(--muted); font-size: 14px; }

/* --- page heads, buttons ------------------------------------------------- */
.page-head { display: flex; align-items: center; gap: 8px; }
.icon-btn { font: inherit; font-size: 18px; line-height: 1; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { border-color: var(--line); color: var(--brand); outline: none; }
.tools { align-items: center; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8f1c13; }
.danger-text { color: var(--danger) !important; }
.link-btn { font: inherit; font-size: 13px; font-weight: 600; background: none; border: 0; padding: 2px 4px; color: var(--brand); cursor: pointer; border-radius: 4px; }
.link-btn:hover, .link-btn:focus-visible { text-decoration: underline; outline: none; }
.folder-actions { margin-left: auto; display: flex; gap: 4px; opacity: .85; }
.folder > summary { flex-wrap: wrap; }

/* --- row menu ------------------------------------------------------------ */
.menu { position: relative; }
.menu > summary { list-style: none; padding: 7px 12px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 170px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(3, 68, 91, .14); padding: 6px; display: grid; }
.menu-item { font: inherit; font-size: 14px; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--soft); outline: none; }

/* --- dialog and notice --------------------------------------------------- */
.dlg { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); font-family: inherit; color: var(--ink); }
.dlg::backdrop { background: rgba(10, 30, 40, .4); }
.dlg form { padding: 22px; }
.dlg h2 { margin: 0 0 8px; font-size: 19px; }
.dlg p { margin: 0 0 10px; color: var(--muted); }
.dlg .field { margin-top: 10px; }
.dlg .error { margin: 10px 0 0; font-size: 14px; }
.dlg-actions, .form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.form-actions.start { justify-content: flex-start; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- publish page -------------------------------------------------------- */
main.narrow { max-width: 680px; }
.drop { display: grid; place-items: center; gap: 4px; padding: 40px 16px; border: 2px dashed #b9d3dc; border-radius: 14px; background: var(--soft); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--brand-2); background: #eaf5f9; }
.drop.busy { opacity: .6; pointer-events: none; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { font-weight: 700; color: var(--brand); font-size: 17px; }
.drop-sub { color: var(--muted); font-size: 14px; }
.summary { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.summary b { font-size: 17px; color: var(--brand); }
.summary span { color: var(--muted); font-size: 14px; word-break: break-word; }
.note { padding: 12px 14px; border-radius: var(--radius); background: #eaf5f9; color: var(--brand); margin-bottom: 12px; font-size: 14px; }
.problems { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.problems li { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.problems li.error { background: #fdecea; color: var(--danger); }
.problems li.warn { background: #fff7e0; color: #7a5300; }
#form .field { margin-top: 16px; }
/* Text boxes and the client dropdown share one look: same height, border, font and corners. */
.field input, #form select { box-sizing: border-box; height: 44px; font: inherit; font-size: 15px; color: var(--ink); }
#form select {
  width: 100%; padding: 0 42px 0 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2303445b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center / 12px 8px;
}
#form select:hover, .field input:hover { border-color: #b9d3dc; }
#form select:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
#form select:invalid, #form select option[value=""] { color: var(--muted); }
#form select option { color: var(--ink); }
.slug-row input { height: 42px; }
.indent { margin-left: 14px; padding-left: 12px; border-left: 3px solid var(--line); }
.slug-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.slug-row:focus-within { outline: 2px solid var(--brand-2); border-color: transparent; }
.slug-prefix { background: var(--soft); color: var(--muted); padding: 9px 4px 9px 12px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.slug-row input { border: 0 !important; outline: none !important; flex: 1; min-width: 80px; padding-left: 4px !important; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; }
.check input { margin-top: 3px; }
.done { padding: 24px; border: 1px solid var(--line); border-radius: 14px; }
.done h2 { margin: 0 0 6px; color: var(--brand); }
.done code { display: block; margin: 10px 0 0; word-break: break-all; color: var(--muted); }
@media (max-width: 600px) { .row-actions { width: 100%; } .slug-prefix { max-width: 45%; } }

.push-right { margin-left: auto; }

/* --- dashboards made from the same Claude link -------------------------- */
.warn-mark { color: var(--warn); font-weight: 700; }
.same-note { font-size: 13px; color: #8a4a06; }
.same-note a { color: inherit; font-weight: 600; }
.same-warn { padding: 12px 14px; border: 1px solid #f3c48b; border-left: 4px solid var(--warn); border-radius: 8px; background: #fff6ec; margin-bottom: 12px; font-size: 14px; }
.same-warn p { margin: 0 0 6px; }
.same-warn .same-more { color: var(--muted); }
.same-warn .check { margin-top: 6px; }
.slug-taken { font-size: 14px; margin: 6px 0 0; }

/* --- Open > Main data / Staging data ------------------------------------- */
.open-menu .menu-list { left: 0; right: auto; }
a.menu-item { text-decoration: none; display: block; }
.staging-item { color: var(--warn); font-weight: 600; }

/* Publish several dashboards at once (publish-batch.js) */
.batch-head { font-size: 18px; margin: 24px 0 10px; }
.batch-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.batch-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.batch-row.has-error { border-color: var(--danger); }
.batch-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.batch-row-name { display: grid; gap: 2px; min-width: 0; }
.batch-row-name .muted { font-size: 13px; overflow-wrap: anywhere; }
.batch-row-sum { font-size: 13px; margin: 6px 0 4px; overflow-wrap: anywhere; }
.batch-row .problems { margin: 8px 0 0; }
.batch-row .same-warn { margin-top: 10px; }
.batch-row .error { margin: 8px 0 0; }
.batch-mode .check { margin-top: 8px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.batch-done { padding-left: 18px; display: grid; gap: 6px; margin: 10px 0 0; overflow-wrap: anywhere; }
