/* EasyKeynoter portal (design: the "EasyKeynoter Web Portal" canvas). IBM Plex Sans; ground #F4F5F7, white cards,
   one blue accent (the add-in's). The add-in's subscription styles (sub-*) are at the end, on the same tokens. */
:root {
  --bg: #F4F5F7;
  --panel: #FFFFFF;
  --panel-alt: #F4F5F7;
  --fg: #1B1F24;
  --fg-2: #3D434A;
  --muted: #59606A;
  --line: #E1E4E8;
  --line-soft: #EEF0F2;
  --field: #C9CED4;
  --accent: #1F5F9E;
  --accent-dark: #174A7C;
  --accent-soft: #E8F0F8;
  --hover: #F0F3F7;
  --danger: #A1281C;
  --warn-bg: #FFF4E5;
  --warn-fg: #8A4B00;
  --ok: #1E6B3A;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { margin: 0; font-size: 28px; font-weight: 600; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; }
.strong { font-weight: 600; text-decoration: none; }
.error { color: var(--danger); }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--fg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.centre-text { text-align: center; }
.struck { text-decoration: line-through; color: var(--muted); }
.boot { padding: 48px; text-align: center; color: var(--muted); }

/* ---- controls ---- */
button, .button { font: inherit; cursor: pointer; }
.primary, .secondary, .danger, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.primary { border: 0; background: var(--accent); color: #FFFFFF; font-weight: 600; }
.primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.secondary, .button.secondary { border: 1px solid var(--field); background: var(--panel); color: var(--fg); }
.secondary:hover { background: var(--hover); color: var(--fg); }
.danger { border: 0; background: var(--danger); color: #FFFFFF; font-weight: 600; }
.danger-text { color: var(--danger); border-color: #E3B4AE; }
.small-button { min-height: 36px; padding: 0 12px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.link.small { font-size: 13px; margin-left: 6px; }
.text {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--panel);
  color: var(--fg); font: inherit;
}
select.text { padding: 0 8px; min-height: 40px; }
.text:focus, .primary:focus-visible, .secondary:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.text.full { width: 100%; }
.text.code { min-height: 52px; font-size: 24px; letter-spacing: 8px; text-align: center; }
label { font-size: 13px; color: var(--muted); }
.file-button { position: relative; overflow: hidden; }
.file-button input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- shell ---- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.rail {
  flex: 1 1 240px; max-width: 100%; padding: 24px 16px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #FFFFFF; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 12px; color: var(--muted); }
.rail-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius); color: var(--fg); text-decoration: none; }
.rail-link:hover { background: var(--hover); color: var(--fg); }
.rail-link.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail-note { margin: 8px 12px 0; font-size: 12px; color: var(--muted); }
.rail-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.rail-foot strong { font-size: 14px; }
.rail-foot span { font-size: 13px; color: var(--muted); }
.rail-foot .link { margin-top: 6px; font-size: 13px; }
.page { flex: 999 1 560px; min-width: 0; padding: 40px 48px; }
@media (max-width: 860px) {
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-foot { margin-top: 12px; }
  .page { padding: 24px 16px; }
}

/* ---- page parts ---- */
.content { max-width: 1080px; display: flex; flex-direction: column; gap: 28px; }
.content.wide { max-width: 1320px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; max-width: 680px; }
.back { font-size: 13px; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.push { margin-left: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
h2.card-head { display: block; }
.pad { padding: 16px 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row.card { padding: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; }
.field.grow { flex: 2 1 260px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form .text { min-height: 36px; max-width: 180px; }
.cell-stack { display: flex; flex-direction: column; }
.button-row { display: inline-flex; gap: 8px; }
.badge { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }

/* ---- tables ---- */
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 12px 16px; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td { padding: 14px 16px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.end { text-align: right; }
tr.dim td { color: var(--muted); }
table.roles th[scope=col] { text-align: center; color: var(--fg); font-weight: 600; width: 120px; }
table.roles th[scope=row] { color: var(--fg); font-weight: 400; font-size: 14px; border-top: 1px solid var(--line-soft); }
table.roles td { text-align: center; font-weight: 600; }
td.yes { color: var(--ok); }
td.no { color: var(--muted); font-weight: 400; }

/* ---- the set editor ---- */
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 3 1 520px; min-width: 0; }
.col-side { flex: 2 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.tree { list-style: none; margin: 0; padding: 0 0 8px; font-size: 14px; max-height: 70vh; overflow: auto; }
.tree li { display: flex; align-items: center; gap: 4px; min-height: 40px; padding-right: 16px; }
.tree li.current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.twisty, .twisty-space { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.twisty { border: 0; background: none; color: var(--muted); border-radius: 6px; }
.twisty:hover { background: var(--hover); }
.tree-row { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: baseline; text-align: left; border: 0; background: none; color: inherit; padding: 8px 4px; font: inherit; }
.tree-row .key { min-width: 120px; flex: none; }
.tree li.current .key { color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.list li:first-child { border-top: 0; }
.list-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---- signing in ---- */
.bare { min-height: 100vh; padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.bare .mark { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.bare .brand-text strong { font-size: 18px; }
.bare .brand-text span { font-size: 13px; }
.bare-stack { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.bare-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.bare-card h1 { font-size: 22px; margin-bottom: 4px; }
.bare-card h2 { font-size: 15px; }
.bare-card p { font-size: 14px; color: var(--fg-2); }
.row-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.choice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.choice-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.choice-list li > span { display: flex; flex-direction: column; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 20px; background: #FFF4E5; color: var(--fg); box-shadow: 0 -1px 4px rgba(0,0,0,.15); z-index: 10; }
#blazor-error-ui .dismiss { float: right; border: 0; background: none; font-size: 18px; }

/* ---- the subscription panel (the add-in's sub-* styles) ---- */
.sub-host { display: block; }
.sub-host fieldset { margin: 0; padding: 0; border: 0; }
.sub-host legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.sub-card, .sub-summary, .sub-card-form { display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.sub-card p, .sub-summary p, .sub-card-form p, .sub-flow p { margin: 0; }
.sub-card .primary { align-self: flex-start; }
.sub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sub-card-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sub-card-title h2, .sub-heading { margin: 0; font-size: 15px; font-weight: 600; }
.sub-summary h3, .sub-card-form h3 { margin: 0; font-size: 14px; font-weight: 600; }
.sub-badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sub-badge.warn { background: #fff4e5; color: #8a4b00; }
.sub-badge.danger { background: #fdecea; color: #b42318; }
.sub-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sub-stats > div { display: flex; flex-direction: column; gap: 2px; }
.sub-stats strong { font-size: 18px; font-weight: 600; }
.sub-note { padding: 8px 10px; border-radius: 4px; font-size: 12px; }
.sub-note.test { background: var(--accent-soft); color: var(--fg); }
.sub-note.ok { background: #e7f4ec; color: #1e5c37; }
.sub-flow { display: flex; flex-direction: column; gap: 16px; }
.sub-flow fieldset > p { margin: 0 0 8px; }
.sub-back { align-self: flex-start; text-decoration: none; font-weight: 600; }
.sub-back:disabled { opacity: .5; cursor: default; }
.sub-stepper { display: flex; align-items: center; flex-wrap: wrap; row-gap: 6px; }
.sub-stepper button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--panel-alt); font-size: 18px;
  line-height: 1; cursor: pointer; }
.sub-stepper button:first-child { border-radius: 4px 0 0 4px; }
.sub-stepper input + button { border-radius: 0 4px 4px 0; }
.sub-stepper button:disabled { opacity: .45; cursor: default; }
.sub-stepper input { width: 64px; height: 36px; box-sizing: border-box; border: 1px solid var(--line); border-left: 0; border-right: 0;
  background: var(--panel); color: var(--fg); text-align: center; font: 600 15px 'IBM Plex Sans', system-ui, sans-serif; -moz-appearance: textfield; }
.sub-stepper input::-webkit-inner-spin-button, .sub-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sub-stepper input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.sub-stepper > span { margin-left: 10px; }
.sub-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.sub-options button { min-height: 48px; padding: 6px 10px; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 4px; background: var(--panel);
  cursor: pointer; }
.sub-options button:hover { background: var(--hover); }
.sub-options button.current { border: 2px solid var(--accent); padding: 5px 9px; background: var(--accent-soft); }
.sub-field { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sub-coupon { display: flex; gap: 6px; }
.sub-coupon input { flex: 1; min-width: 0; text-transform: uppercase; }
.sub-coupon input::placeholder { text-transform: none; }
.sub-lines { display: flex; flex-direction: column; gap: 8px; }
.sub-line, .sub-total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sub-line-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sub-line + .sub-total-row { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.sub-total { font-weight: 600; font-size: 15px; }
.sub-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sub-go { width: 100%; min-height: 40px; }
.sub-card-form-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sub-done { align-items: center; text-align: center; }
.sub-done .sub-stats { width: 100%; text-align: left; }
.sub-done-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.sub-done-icon.ok { background: #e7f4ec; color: #1e7a44; }
.sub-done-icon.wait { background: var(--accent-soft); color: var(--accent); }
.stripe-host { min-height: 0; }

/* ---- keynote sets in folders ---- */
.card-head.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.st-search { min-height: 36px; width: 240px; max-width: 100%; }
.set-tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.set-tree > li { border-top: 1px solid var(--line-soft); }
.set-tree > li:first-child { border-top: 0; }
.st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 20px 10px 12px; min-height: 52px; }
.st-name { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; }
.st-folder .st-name strong { font-weight: 600; }
.st-meta { color: var(--muted); font-size: 13px; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; justify-content: flex-end; }
.st-actions .link.small { margin-left: 0; }
.st-panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 20px 18px 52px; background: var(--panel-alt); border-top: 1px solid var(--line-soft); }
.card > .st-panel { border-top: 0; padding-left: 20px; border-radius: var(--radius); }
.st-panel fieldset { margin: 0; padding: 0; border: 0; }
.st-panel legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.st-people { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 6px; }
.st-people label { display: inline-flex; align-items: center; gap: 6px; }

/* ---- keynote requests ---- */
.badge.ok { background: #E7F4EC; color: var(--ok); }
.seg-tabs { display: inline-flex; border: 1px solid var(--field); border-radius: var(--radius); overflow: hidden; }
.seg-tabs button { min-height: 36px; padding: 0 14px; border: 0; background: var(--panel); color: var(--fg); font: inherit; cursor: pointer; }
.seg-tabs button + button { border-left: 1px solid var(--field); }
.seg-tabs button.on { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.rq-change { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.rq-change > .muted { min-width: 90px; }
.rq-thread { list-style: none; margin: 0; padding: 16px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.rq-thread li { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: var(--radius); background: var(--panel-alt); margin-right: 15%; }
.rq-thread li.keeper { background: var(--accent-soft); margin: 0 0 0 15%; }
.rq-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-reply { min-height: 80px; resize: vertical; font: inherit; }
.st-full { flex-basis: 100%; }
.badge.template { background: var(--accent-soft); color: var(--accent); }

/* ---- installable app: "new version" and "install" bar (js/pwa.js) ---- */
.pwa-bar { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 8px 24px rgba(27, 31, 36, .14); font-size: 14px; }
.pwa-bar[hidden] { display: none; }
.pwa-bar .link { margin-left: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; }
