/* Palette and type follow www.hua.gr */
:root {
  --hua-blue: #004976;      /* primary brand blue */
  --hua-blue-dark: #01162d; /* deep navy */
  --hua-navy: #2c3c5c;
  --hua-cyan: #5fbad5;      /* accent */
  --hua-sky: #6198b9;
  --hua-wine: #a85467;
  --hua-ochre: #c88242;

  --bg: #f6f6f6;
  --card: #ffffff;
  --text: #1f2a37;
  --heading: var(--hua-blue);
  --muted: #6b7280;
  --line: #dfe3e8;
  --accent: var(--hua-blue);
  --accent-hover: var(--hua-blue-dark);
  --accent-ink: #ffffff;
  --focus: rgba(95, 186, 213, .45);
  --danger: #b3261e;
  --ok: #1e7b45;
  --warn-bg: #fdf3e6;
  --err-bg: #fbe9e7;
  --radius: 6px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--heading); }
h2 { font-size: 1.08rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; }
h3 { font-size: .92rem; font-weight: 600; }
a { color: var(--hua-blue); }
code { font-family: var(--mono); font-size: .85em; background: #eef3f7; color: var(--hua-blue-dark); padding: 1px 4px; border-radius: 3px; }
code.block { display: block; padding: .5rem; margin-top: .4rem; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.bad { color: var(--danger); }

/* ---------- controls */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .84rem; color: var(--hua-navy); flex: 1 1 180px; min-width: 0; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=search], select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 4px; padding: .5rem .6rem; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--hua-cyan); }
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.narrow { max-width: 7rem; }
.hint { font-weight: 400; font-size: .78rem; color: var(--muted); }
p.hint { margin: .45rem 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--hua-blue); background: #fff; color: var(--hua-blue);
  padding: .5rem .95rem; border-radius: 4px; flex: 0 0 auto; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #e9f2f8; }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--err-bg); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--hua-navy); }
.btn.ghost:hover { border-color: var(--hua-blue); color: var(--hua-blue); background: #f2f7fa; }
.btn.on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn.on-dark:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn.small { padding: .32rem .65rem; font-size: .8rem; }
.btn.tiny { padding: .1rem .42rem; font-size: .8rem; }
.btn.wide { width: 100%; padding: .7rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }

.row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .8rem; align-items: flex-end; }
.row.tight { gap: .5rem; margin-bottom: .6rem; }
.row.top { align-items: flex-start; }
.row.end, .toolbar.end { justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.toolbar select { width: auto; padding: .3rem .4rem; font-size: .82rem; }
label.btn { flex-direction: row; flex: 0 0 auto; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: calc(.55rem + env(safe-area-inset-top, 0px)) 1.25rem .55rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
  background: var(--hua-blue); color: #fff; border-bottom: 4px solid var(--hua-cyan);
}
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.brand-tagline { font-size: .76rem; color: rgba(255,255,255,.78); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.btn.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: .3rem .45rem; line-height: 0; }
.login-top-actions { display: flex; align-items: center; gap: .6rem; }
.user { display: flex; align-items: center; gap: .5rem; margin-left: .25rem; }
.user img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.user-email { font-size: .82rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user form { margin: 0; }
@media (max-width: 720px) {
  .brand-logo { height: 28px; }
  .brand-sep, .brand-tagline, .user-email { display: none; }
}

.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.55); border-radius: 4px; overflow: hidden; }
.lang-switch a { color: #fff; text-decoration: none; font-size: .78rem; font-weight: 700; padding: .3rem .55rem; letter-spacing: .04em; }
.lang-switch a:hover { background: rgba(255,255,255,.12); }
.lang-switch a.active { background: #fff; color: var(--hua-blue); }

/* ---------- layout */
.layout {
  flex: 1; width: 100%; min-width: 0;
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1rem 1.25rem 2.5rem; max-width: 1400px; margin: 0 auto;
}
@media (max-width: 700px) { .layout { padding-inline: 1rem; } }
.page-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.collapse-tools { display: flex; gap: .4rem; margin-left: auto; }

/* view switch: vertical (preview below) / horizontal (preview on the right) */
.view-switch { display: inline-flex; align-items: center; gap: .5rem; }
.view-label { font-size: .82rem; font-weight: 600; color: var(--hua-navy); }
.seg {
  display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .8rem; font-weight: 600;
  padding: .32rem .7rem; cursor: pointer; background: #fff; color: var(--hua-navy);
  border: 1px solid var(--line); margin: 0;
}
.seg + .seg { margin-left: -1px; }
.seg:first-of-type { border-radius: 4px 0 0 4px; }
.seg:last-of-type { border-radius: 0 4px 4px 0; }
.seg:hover { color: var(--hua-blue); background: #f2f7fa; }
.seg[aria-pressed="true"] { background: var(--hua-blue); border-color: var(--hua-blue); color: #fff; position: relative; }
.seg:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; position: relative; }

.cols, .col-config, .col-preview { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

@media (min-width: 1000px) {
  .view-horizontal .layout { max-width: 1700px; }
  .view-horizontal .cols {
    /* columns stretch to equal height so the preview can stick while the settings scroll */
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr); align-items: stretch; gap: 1.1rem;
  }
  .view-horizontal #preview-card {
    position: sticky; top: 5.4rem; max-height: calc(100vh - 6.4rem); overflow: auto;
  }
  /* leave room for header, stats and send controls so "Send all" stays visible */
  .view-horizontal #pv-frame { height: clamp(280px, calc(100vh - 37rem), 640px); }
}
@media (max-width: 999px) { .view-switch { display: none; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--hua-blue);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: 0 1px 2px rgba(1, 22, 45, .05); min-width: 0;
}
.card > label { margin-bottom: .8rem; }
#preview-card { border-top-color: var(--hua-cyan); }

/* collapsible sections */
.card-head { flex-wrap: wrap; }
h2.card-head, .card-head h2 { cursor: pointer; user-select: none; }
.collapse-btn { margin-left: auto; font-size: .78rem; }
.collapse-btn .chev { display: inline-block; transition: transform .15s; }
.card-summary { display: none; font-size: .82rem; font-weight: 400; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.card.collapsed { padding-block: .75rem; }
.card.collapsed > :not(.card-head) { display: none !important; }
.card.collapsed h2 { margin-bottom: 0; }
.card.collapsed .card-summary { display: inline; }
.card.collapsed .collapse-btn .chev { transform: rotate(-90deg); }
.card.collapsed .pager { display: none; }
.step {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: 0 0 auto;
  background: var(--hua-blue); color: #fff; font-size: .82rem; font-weight: 700;
}
.subhead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .5rem; }

.dropzone {
  border: 2px dashed #b9cfdd; border-radius: var(--radius); padding: 1.4rem; text-align: center;
  color: var(--hua-navy); background: #f8fbfd; cursor: pointer; font-weight: 400; align-items: center;
}
.dropzone u { color: var(--hua-blue); font-weight: 600; }
.dropzone.small { padding: .85rem; }
.dropzone.over, .dropzone:hover { border-color: var(--hua-cyan); background: #eef8fb; }

.radio-group { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .45rem; }
.radio-group legend { font-weight: 600; font-size: .84rem; color: var(--hua-navy); margin-bottom: .35rem; }
.radio-group label { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .45rem; flex-wrap: wrap; font-weight: 400; font-size: .9rem; color: var(--text); }
.radio-group select { width: auto; max-width: 14rem; }
input[type=radio], input[type=checkbox] { accent-color: var(--hua-blue); }

.filter-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: .4rem; margin-bottom: .4rem; }
@media (max-width: 560px) { .filter-row { grid-template-columns: 1fr 1fr; } }

.table-cols { display: flex; flex-direction: column; gap: .3rem; }
.tc-row { display: grid; grid-template-columns: auto minmax(0, 9rem) minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; }
.tc-row.off code, .tc-row.off input[type=text] { opacity: .45; }
.tc-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-row .hl { flex-direction: row; align-items: center; gap: .25rem; flex: 0 0 auto; }
.tc-row input[type=color] { width: 2rem; height: 1.6rem; padding: 0; border: 1px solid var(--line); border-radius: 3px; }
.tc-row input[type=color]:disabled { opacity: .3; }
.moves { display: flex; }
@media (max-width: 560px) { .tc-row { grid-template-columns: auto minmax(0, 1fr) auto; } .tc-row code { grid-column: 2 / 4; } }

.files { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-direction: column; gap: .3rem; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .4rem .55rem; border: 1px solid var(--line); border-left: 3px solid var(--hua-cyan); border-radius: 4px; }
.files .fname { font-weight: 600; margin-right: auto; word-break: break-all; }
.files label { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .3rem; font-weight: 400; color: var(--text); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
table.data { border-collapse: collapse; font-size: .78rem; width: 100%; }
table.data th, table.data td { padding: .35rem .55rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
table.data th { background: var(--hua-blue); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.data tbody tr:nth-child(even) { background: #f7fafc; }

/* ---------- preview */
.preview-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.preview-head h2 { margin: 0; }
.preview-head .pager { margin-left: auto; }
.preview-head .collapse-btn { margin-left: .25rem; }
.card.collapsed .preview-head .collapse-btn { margin-left: auto; }
.pager { display: flex; align-items: center; gap: .35rem; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--hua-navy); }
.stats { margin: 0 0 .65rem; font-size: .88rem; }
.stats strong { color: var(--hua-blue); font-size: 1.05rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0 0 .55rem; font-size: .85rem; }
.meta dt { color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; word-break: break-word; }
.warnings { list-style: none; padding: 0; margin: 0 0 .5rem; }
.warnings li { background: var(--warn-bg); border-left: 3px solid var(--hua-ochre); border-radius: 3px; padding: .35rem .6rem; margin-bottom: .25rem; font-size: .82rem; }
#pv-frame { width: 100%; height: clamp(420px, 65vh, 720px); border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.send-box {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: .75rem 1.5rem; align-items: end;
}
.send-box .row { margin: 0; }
.send-box label { flex: 1 1 110px; }

#job { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.job-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.job-head strong { color: var(--hua-blue); }
progress { width: 100%; height: 10px; margin: .45rem 0; accent-color: var(--hua-cyan); }
.log { max-height: 260px; overflow: auto; }
tr.st-sent td:nth-child(3) { color: var(--ok); font-weight: 600; }
tr.st-failed td:nth-child(3) { color: var(--danger); font-weight: 700; }
tr.st-skipped td:nth-child(3) { color: #9a5a12; }
.problems { background: #fdf1f0; border: 1px solid #f0c4bf; border-left: 4px solid var(--danger); border-radius: 4px; padding: .6rem .8rem; margin: .6rem 0; }
.problems strong { color: var(--danger); }
.problems ul { list-style: none; margin: .4rem 0; padding: 0; max-height: 360px; overflow: auto; }
.problems li { padding: .35rem 0; border-top: 1px solid #f3d6d3; font-size: .85rem; overflow-wrap: anywhere; }
.problems li:first-child { border-top: 0; }
.problems .pr-status { margin-left: .5rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--danger); }
.problems li.st-skipped .pr-status { color: #9a5a12; }
.problems li.st-sent .pr-status { color: var(--ok); }
.problems .hint { margin: .3rem 0 0; }

.alert { border-radius: 4px; padding: .65rem .85rem; margin: .55rem 0; font-size: .88rem; }
.alert p { margin: .4rem 0 0; }
.alert.error { background: var(--err-bg); color: #8c1d18; border-left: 3px solid var(--danger); }
.alert.warn { background: var(--warn-bg); border-left: 3px solid var(--hua-ochre); }

dialog { border: 0; border-top: 4px solid var(--hua-blue); border-radius: var(--radius); padding: 1.4rem; max-width: min(460px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(1, 22, 45, .3); }
dialog::backdrop { background: rgba(1, 22, 45, .55); }
dialog h2 { margin-bottom: .5rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--hua-blue-dark); color: #fff; padding: .65rem 1.05rem; border-radius: 4px; z-index: 50; max-width: calc(100vw - 32px);
  box-shadow: 0 6px 20px rgba(1, 22, 45, .3);
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- footer */
.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--hua-blue-dark); color: rgba(255,255,255,.75); font-size: .8rem;
}
.site-footer img { height: 24px; width: auto; opacity: .9; }

/* ---------- landing / sign-in page (same look as surveys.modipapps.hua.gr) */
html:has(body.landing) { scroll-behavior: smooth; scroll-padding-top: 5rem; }
.landing { background: var(--bg); font-size: 15px; }
.landing h1, .landing h2, .landing h3 { font-family: "Barlow Semi Condensed", var(--font); font-weight: 600; letter-spacing: .01em; }
.landing code { font-size: .88em; }

.landing-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: .6rem 1.5rem; flex-wrap: wrap;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) 1.5rem .7rem; background: var(--hua-blue); color: #fff; box-shadow: 0 2px 12px rgba(1,22,45,.25); }
.landing-brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; min-width: 0; }
.landing-brand img { width: 44px; height: 44px; flex: none; }
.landing-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.landing-brand strong { font-family: "Barlow Semi Condensed", var(--font); font-size: 1.2rem; font-weight: 600; }
.landing-brand small { font-size: .78rem; opacity: .85; }
.landing-nav { display: flex; gap: .2rem; margin-right: auto; }
.landing-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; font-size: .9rem; padding: .35rem .75rem; border-radius: 4px; }
.landing-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn.top-signin { background: var(--hua-cyan); border-color: var(--hua-cyan); color: var(--hua-blue-dark); padding: .32rem .9rem; font-size: .85rem; }
.btn.top-signin:hover { background: #7fcbe2; }

/* hero */
.hero { position: relative; overflow: hidden; color: #fff; border-bottom: 4px solid var(--hua-cyan);
  background: radial-gradient(ellipse at 85% 10%, rgba(95,186,213,.28), transparent 55%),
              linear-gradient(135deg, var(--hua-blue) 0%, var(--hua-blue-dark) 100%); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 22px 22px; }
.hero-inner { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem 4.5rem;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: .4rem 0 1rem; line-height: 1.05; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--hua-cyan); }
.lead { font-size: 1.12rem; margin: 0 0 1.8rem; color: rgba(255,255,255,.9); max-width: 34em; }
.hero .alert { max-width: 36em; margin: 0 0 1.2rem; }
.hero .alert.warn { color: var(--text); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.btn.big { padding: .65rem 1.4rem .65rem .65rem; font-size: 1.02rem; gap: .7rem; border-radius: 6px;
  background: var(--hua-cyan); border-color: var(--hua-cyan); color: var(--hua-blue-dark); box-shadow: 0 6px 20px rgba(95,186,213,.35); }
.btn.big:hover { background: #7fcbe2; border-color: #7fcbe2; transform: translateY(-1px); }
.g-chip { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); padding: .75rem 1.2rem; border-radius: 6px; }
.btn.ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.hero-hint { margin: .9rem 0 0; font-size: .85rem; color: rgba(255,255,255,.7); }
.badges { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.badges li { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; font-size: .82rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.92); }
.badges .ico { width: 15px; height: 15px; color: var(--hua-cyan); }

/* hero illustration: list -> personal e-mails */
.mock { display: grid; grid-template-columns: 1fr; gap: .9rem; position: relative; }
.mock-sheet { background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; width: 88%; }
.mock-bar { display: flex; align-items: center; gap: .35rem; padding: .5rem .8rem; background: #eef3f7; border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #cfd6de; }
.mock-bar i:first-child { background: #e8a0a0; } .mock-bar i:nth-child(2) { background: #e8cf8f; } .mock-bar i:nth-child(3) { background: #9fd3a8; }
.mock-bar span { margin-left: .4rem; font-weight: 600; color: var(--hua-blue); }
.mock-sheet table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mock-sheet th { text-align: left; background: var(--hua-blue); color: #fff; font-weight: 600; padding: .4rem .7rem; }
.mock-sheet td { padding: .38rem .7rem; border-top: 1px solid var(--line); }
.mock-sheet td.dim { color: var(--muted); }
.mock-flow { display: flex; justify-content: center; margin: -.2rem 0; }
.mock-flow .chip { font-family: var(--mono); font-size: .8rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px;
  background: var(--hua-cyan); color: var(--hua-blue-dark); box-shadow: 0 4px 14px rgba(95,186,213,.4); }
.mock-mails { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.mail { background: #fff; color: var(--text); border-radius: 8px; padding: .65rem .7rem .75rem; box-shadow: 0 12px 30px rgba(0,0,0,.3);
  border-top: 3px solid var(--hua-cyan); font-size: .74rem; min-width: 0;
  animation: mail-in .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.35s + var(--i) * .25s); }
.mail-head { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .4rem; }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--hua-blue); color: #fff; font-weight: 700; font-size: .7rem;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mail-to { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sent { margin-left: auto; display: inline-flex; align-items: center; gap: .15rem; color: var(--ok); font-weight: 700; font-size: .66rem; }
.sent .ico { width: 12px; height: 12px; stroke-width: 3; }
.mail-subj { margin: 0 0 .25rem; font-weight: 700; color: var(--hua-blue); line-height: 1.25; }
.mail-body { margin: 0 0 .4rem; color: var(--muted); line-height: 1.3; }
.mail .line { display: block; height: 5px; border-radius: 3px; background: #e6ebf0; margin-top: .3rem; }
.mail .line.short { width: 60%; }
@keyframes mail-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mail { animation: none; } html:has(body.landing) { scroll-behavior: auto; } }

/* facts strip */
.facts { background: var(--card); border-bottom: 1px solid var(--line); }
.facts-inner { max-width: 1200px; margin: 0 auto; padding: 1.3rem 1.5rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.facts-inner div { display: flex; flex-direction: column; padding-left: 1rem; border-left: 3px solid var(--hua-cyan); }
.facts strong { font-family: "Barlow Semi Condensed", var(--font); font-size: 1.45rem; font-weight: 600; color: var(--hua-blue); line-height: 1.2; }
.facts span { color: var(--muted); font-size: .85rem; }

/* sections */
.landing-main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.block { padding: 4rem 0 0; }
.kicker { margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--hua-sky); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .6rem; line-height: 1.15; display: block; }
.section-lead { margin: 0 0 2rem; color: var(--muted); font-size: 1.02rem; max-width: 46em; }

.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; counter-reset: s; }
.steps li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem 1.4rem 1.3rem;
  transition: transform .2s, box-shadow .2s, border-color .2s; }
.steps li:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,73,118,.12); border-color: var(--hua-cyan); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--hua-blue); color: #fff; font-weight: 700; font-size: 1.05rem; box-shadow: 0 0 0 5px #e3f1f7; margin-bottom: .9rem; }
.steps h3 { font-size: 1.25rem; margin: 0 0 .35rem; }
.steps p { margin: 0; color: var(--muted); font-size: .93rem; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.6rem; }
.mode { background: linear-gradient(180deg, #fff 0%, #f7fbfd 100%); border: 1px solid var(--line); border-top: 4px solid var(--hua-blue); border-radius: 8px; padding: 1.6rem 1.6rem 1.4rem; }
.mode h3 { font-size: 1.35rem; margin: 1.1rem 0 .35rem; }
.mode p { margin: 0; color: var(--muted); }
.mode .example { margin-top: .7rem; color: var(--hua-blue); font-weight: 600; font-size: .9rem; }
.mode-art { display: flex; align-items: center; gap: 1rem; height: 96px; padding: .8rem 1rem; background: #eef4f8; border-radius: 6px; }
.mode-art .rows { display: flex; flex-direction: column; gap: 4px; width: 42%; }
.mode-art .rows i { display: block; height: 10px; border-radius: 3px; }
.mode-art .arrows { color: var(--hua-sky); font-weight: 700; line-height: 1.35; font-size: .9rem; }
.mode-art .envs { display: flex; flex-direction: column; gap: 6px; }
.mode-art .envs.grouped { gap: 12px; }
.mode-art .envs b { display: block; width: 34px; height: 20px; border-radius: 3px; position: relative; border: 2px solid; background: #fff; }
.mode-art .envs b::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 55%;
  clip-path: polygon(0 0, 100% 0, 50% 100%); background: currentColor; opacity: .55; }
.mode-art .envs b.table { width: 44px; height: 26px; }
.c1 { background: #004976; color: #004976; border-color: #004976 !important; }
.c2 { background: #5fbad5; color: #5fbad5; border-color: #5fbad5 !important; }
.c3 { background: #a85467; color: #a85467; border-color: #a85467 !important; }
.mode-art .envs b.c1, .mode-art .envs b.c2, .mode-art .envs b.c3 { background: #fff; }

.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.6rem; }
.feature-grid article { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.3rem 1.25rem; transition: border-color .2s, box-shadow .2s; }
.feature-grid article:hover { border-color: var(--hua-cyan); box-shadow: 0 10px 24px rgba(0,73,118,.1); }
.feature-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px;
  background: #e3f1f7; color: var(--hua-blue); margin-bottom: .8rem; }
.feature-grid h3, .security-grid h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .9rem; }

/* security band */
.security { margin-top: 4.5rem; color: #fff; background: linear-gradient(135deg, var(--hua-blue-dark) 0%, var(--hua-blue) 100%); }
.security-inner { max-width: 1200px; margin: 0 auto; padding: 3.8rem 1.5rem; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr); gap: 2.5rem; align-items: start; }
.security .kicker { color: var(--hua-cyan); }
.security .section-title { color: #fff; }
.security .section-lead { color: rgba(255,255,255,.8); margin: 0; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.security-grid article { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 1.2rem 1.25rem; }
.security-grid h3 { color: #fff; }
.security-grid p { margin: 0; color: rgba(255,255,255,.78); font-size: .9rem; }
.security .feature-ico { background: rgba(95,186,213,.18); color: var(--hua-cyan); }

/* FAQ + call to action */
.faq-list { display: grid; gap: .6rem; margin-top: 1.4rem; max-width: 860px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0 1.2rem; }
.faq details[open] { border-color: var(--hua-cyan); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; position: relative; font-weight: 600; color: var(--hua-blue); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--hua-sky); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.1rem; color: var(--muted); }

.cta { margin: 4rem 0; padding: 2rem 2.2rem; border-radius: 10px; display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap;
  background: #fbf9ed; border-left: 5px solid var(--hua-blue); }
.cta .seal { width: 96px; height: 96px; border-radius: 50%; background: #fff; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.12); flex: none; }
.cta > div:nth-child(2) { flex: 1; min-width: 240px; }
.cta h2 { font-size: 1.7rem; margin: 0 0 .3rem; display: block; }
.cta p { margin: 0; color: #4a4a3c; }
.cta-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.cta .btn.big { background: var(--hua-blue); border-color: var(--hua-blue); color: #fff; box-shadow: 0 6px 18px rgba(0,73,118,.25); }
.cta .btn.big:hover { background: var(--hua-blue-dark); }
.cta-manual { font-size: .88rem; font-weight: 600; text-decoration: none; }
.cta-manual:hover { text-decoration: underline; }

.landing-footer { justify-content: center; text-align: center; padding-inline: 1.5rem; font-size: .85rem; }

@media (max-width: 1000px) {
  .hero-inner, .security-inner { grid-template-columns: 1fr; }
  .mock { max-width: 560px; }
  .steps, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-nav { display: none; }
}
@media (max-width: 640px) {
  .landing-top, .hero-inner, .landing-main, .facts-inner, .security-inner, .landing-footer { padding-inline: 1rem; }
  .landing-top { position: static; }
  .hero-inner { padding-block: 2.5rem 3rem; gap: 2rem; }
  .steps, .feature-grid, .mode-grid, .security-grid, .facts-inner { grid-template-columns: 1fr; }
  .mock-sheet { width: 100%; }
  .mock-mails { grid-template-columns: 1fr 1fr; }
  .mock-mails .mail:nth-child(3) { display: none; }
  .block { padding-top: 3rem; }
  .cta { padding: 1.5rem 1.3rem; }
  .btn.big { white-space: normal; text-align: left; }
}

/* ---------- body editor: visual (WYSIWYG) + HTML source */
[hidden] { display: none !important; }
.editor-mode { display: inline-flex; margin-left: .35rem; }
.visual-wrap { border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: hidden; }
.visual-wrap:focus-within { border-color: var(--hua-cyan); box-shadow: 0 0 0 3px var(--focus); }
.ed-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: .35rem .4rem; background: #f3f6f9; border-bottom: 1px solid var(--line);
}
.ed-toolbar select { width: auto; padding: .25rem .35rem; font-size: .8rem; margin: 0 2px; }
.ed-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  min-width: 30px; height: 30px; padding: 0 6px; margin: 0; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--hua-navy); font: 600 14px/1 var(--font); cursor: pointer; flex: 0 0 auto;
}
.ed-btn:hover { background: #e2ebf2; color: var(--hua-blue); }
.ed-btn.active { background: #d5e6f1; border-color: #b9cfdd; color: var(--hua-blue); }
.ed-btn:focus-visible { outline: 2px solid var(--hua-cyan); outline-offset: 0; }
.ed-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ed-btn svg .fill { fill: currentColor; stroke: none; }
.ed-btn svg .num { fill: currentColor; stroke: none; font: 700 6px var(--font); }
.ed-btn b, .ed-btn i, .ed-btn u, .ed-btn s { font-size: 15px; font-family: Georgia, "Times New Roman", serif; }
.ed-color { flex-direction: column; gap: 1px; padding-top: 3px; }
.ed-color .glyph { font: 700 14px/1 Georgia, serif; }
.ed-color svg { width: 14px; height: 14px; }
.ed-color .swatch { width: 16px; height: 3px; border-radius: 1px; }
.ed-color input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ed-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ed-frame-wrap { height: 440px; min-height: 180px; resize: vertical; overflow: hidden; }
.ed-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.view-horizontal .ed-frame-wrap { height: 380px; }

/* ---------- recipients source */
.source-switch { display: inline-flex; margin-bottom: .9rem; }
.src-hint { margin: -.35rem 0 .7rem; }
label.grow { flex: 1 1 320px; }
label.inline { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .45rem; }
label.inline select { width: auto; min-width: 10rem; max-width: 22rem; padding: .3rem .45rem; }
.source-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .8rem 0 .2rem; }
.source-bar:not(:has(> :not([hidden]))) { display: none; }

/* ---- sending loader */
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
  border: 2px solid rgba(0, 73, 118, .2); border-top-color: var(--hua-blue, #004976);
  animation: spin .8s linear infinite; margin-right: 6px; }
.spinner.light { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; width: 22px; height: 22px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.send-loader { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; border: 0; border-radius: 10px;
  background: var(--hua-blue, #004976); color: #fff; font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); overflow: hidden; min-width: 210px; }
.send-loader strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.send-loader .small { opacity: .85; }
.send-loader .loader-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .2); }
.send-loader .loader-bar span { display: block; height: 100%; width: 0; background: #5fbad5; transition: width .4s; }
/* ---- daily-limit warning in the confirm dialog */
.limit-warn { margin: 12px 0; padding: 10px 14px; border-left: 4px solid #c0392b; background: #fdecea; color: #7b1d14; border-radius: 4px; }
.limit-warn ul { margin: 6px 0 0; padding-left: 18px; }
.limit-warn li { margin: 4px 0; }
#confirm-ok.danger-confirm { background: #c0392b; border-color: #c0392b; }

/* ---- help tooltips (app page) */
label > .lbl { display: inline-flex; align-items: center; gap: .3rem; }
.tip {
  display: inline-flex; align-items: center; justify-content: center; flex: none; vertical-align: middle;
  width: 17px; height: 17px; border-radius: 50%; margin-left: .15rem;
  font: 700 11px/1 var(--font); color: var(--hua-blue); background: #e3f1f7; border: 1px solid #b9dcea;
  cursor: help; user-select: none; transition: background .15s, color .15s;
}
.tip:hover, .tip:focus-visible { background: var(--hua-blue); color: #fff; border-color: var(--hua-blue); }
.tip:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
h2 .tip, h3 .tip, legend .tip { position: relative; top: -1px; }
.tip-box {
  position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); pointer-events: none;
  padding: .55rem .75rem; border-radius: 6px; background: var(--hua-blue-dark); color: #fff;
  font: 400 .8rem/1.45 var(--font); box-shadow: 0 8px 24px rgba(1, 22, 45, .3);
}
.tip-box::after {
  content: ""; position: absolute; left: var(--arrow-x, 50%); top: 100%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--hua-blue-dark);
}
.tip-box.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--hua-blue-dark); }

/* ---- examples */
button.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--hua-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.linklike:hover { color: var(--hua-blue-dark); }
.ex-hint { margin-top: .6rem; }
dialog.examples-dialog { max-width: min(980px, calc(100vw - 32px)); width: 100%; padding: 1.4rem 1.5rem 1.2rem; }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ex-head h2 { margin: 0; font-size: 1.3rem; }
.ex-intro { margin: .5rem 0 1.1rem; max-width: 62em; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.ex-card { display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--line); border-top: 3px solid var(--hua-cyan); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; background: #fff; }
.ex-card h3 { font-size: 1.05rem; margin: 0; }
.ex-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.ex-mode { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--hua-blue); background: #e3f1f7; border-radius: 999px; padding: .15rem .6rem; }
.ex-learn { margin: .1rem 0 0; padding-left: 1.1rem; font-size: .84rem; color: var(--hua-navy); }
.ex-learn li { margin: .1rem 0; }
.ex-files { font-size: .84rem; margin-top: auto; }
.ex-files summary { cursor: pointer; color: var(--hua-blue); font-weight: 600; padding: .2rem 0; }
.ex-files ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.ex-files a { word-break: break-all; }
.ex-card .btn.primary { margin-top: .3rem; }
.ex-note { margin: 1rem 0 0; }
@media (max-width: 520px) { dialog.examples-dialog { padding: 1.1rem 1rem; } }

/* ---- names in the vocative / accusative */
.name-cases { margin-top: 1rem; border-top: 1px dashed var(--line); }
.nc-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; }
.nc-cases { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.nc-cases label, .nc-toggle { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; font-size: .88rem; color: var(--text); }
.nc-cases input, .nc-toggle input { width: auto; }
#nc-status { margin: .65rem 0 0; line-height: 1.7; }
#nc-status code { margin-right: .2rem; }
table.data th.gen { background: var(--hua-sky); }

.nc-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1.4rem; margin-bottom: .75rem; }
.nc-search { flex: 1 1 220px; max-width: 340px; }
.nc-toggle::before { content: ""; width: .75rem; height: .75rem; border-radius: 2px; order: 2; }
.nc-toggle:has(#nc-only-check)::before { background: var(--warn-bg); border: 1px solid var(--hua-ochre); }
.nc-toggle:has(#nc-only-edited)::before { background: #fff; border: 1px solid var(--hua-blue); box-shadow: inset 3px 0 0 var(--hua-blue); }
.nc-toggle span { order: 3; }
.nc-scroll { max-height: min(55vh, 560px); overflow: auto; }
.nc-table td { vertical-align: middle; }
.nc-table td.num { text-align: right; color: var(--muted); }
.nc-where { color: var(--muted); font-size: .72rem; margin-left: .25rem; }
.nc-cell { min-width: 12rem; }
.nc-cell input { padding: .28rem .45rem; font-size: .82rem; }
.nc-cell.flag input { background: var(--warn-bg); border-color: var(--hua-ochre); }
.nc-cell.edited input { border-color: var(--hua-blue); box-shadow: inset 3px 0 0 var(--hua-blue); }
.nc-foot { margin: 1rem 0 0; }
