:root {
  --navy: #0f1b30; --cyan: #60f2fe; --beige: #fffde3; --ink: #0f1b30; --muted: #5b6678;
  --line: #e3e8ef; --bg: #f4f7fa; --card: #ffffff; --soft: #f0fdff; --danger: #c0263a; --ok: #12805c;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: light; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: #0a6e7a; }
.top { background: var(--navy); border-bottom: 4px solid var(--cyan); }
.top .in { max-width: 920px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { height: 38px; display: block; }
.top .who { color: #c7d2e3; font-size: 14px; }
.top a.nav { color: var(--cyan); text-decoration: none; font-weight: 600; font-size: 14px; margin-left: 16px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 56px; }
.wrap.wide { max-width: 1120px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.card h2 .n { display: inline-block; background: var(--navy); color: var(--cyan); width: 26px; height: 26px; border-radius: 7px; text-align: center; line-height: 26px; font-size: 14px; margin-right: 8px; }
.help { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid #cfd8e3; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(96,242,254,.55); border-color: #0a8f9d; }
textarea { min-height: 120px; resize: vertical; }
textarea.big { min-height: 340px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.5; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.row .field { margin-bottom: 0; }
.btn { display: inline-block; background: var(--cyan); color: var(--navy); font: inherit; font-weight: 700; border: 0; border-radius: 9px; padding: 12px 20px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.dark { background: var(--navy); color: #fff; }
.btn.ghost { background: #fff; border: 1.5px solid #cfd8e3; color: var(--ink); }
.btn.danger { background: #fff; border: 1.5px solid var(--danger); color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.err { color: var(--danger); font-size: 14px; margin-top: 6px; min-height: 1px; }
.alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 15px; }
.alert.bad { background: #fdecee; color: #7d1523; border: 1px solid #f3c2c9; }
.alert.good { background: #e8f8f1; color: #0b5a40; border: 1px solid #b9e8d4; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 28px; box-shadow: 0 1px 3px rgba(15,27,48,.06); overflow-x: auto; }
.pad { border: 2px dashed #9fb0c5; border-radius: 10px; background: #fcfeff; touch-action: none; position: relative; }
.pad canvas { display: block; width: 100%; height: 170px; border-radius: 10px; cursor: crosshair; touch-action: none; }
.pad .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa9bd; pointer-events: none; font-size: 15px; }
.typed { border: 2px dashed #9fb0c5; border-radius: 10px; background: #fcfeff; height: 170px; display: flex; align-items: center; justify-content: center; font: italic 46px/1.1 "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive; padding: 0 12px; overflow: hidden; text-align: center; }
.tabs { display: inline-flex; background: #e9eef5; border-radius: 9px; padding: 3px; margin-bottom: 10px; }
.tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; padding: 7px 16px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,48,.15); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: #0a8f9d; }
.center { text-align: center; }
.big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--cyan); color: var(--navy); font-size: 34px; line-height: 64px; margin: 6px auto 14px; font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px; }
.hidden { display: none !important; }
/* admin */
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafcfe; }
table.list td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill.pending { background: #fff4d6; color: #7a5600; } .pill.signed { background: #dff5ea; color: #0b5a40; } .pill.void { background: #eceff3; color: #5b6678; }
.items-edit .it { display: grid; grid-template-columns: 2fr 2fr 110px 120px 40px; gap: 8px; margin-bottom: 8px; align-items: start; }
.items-edit .it .x { background: #fff; border: 1.5px solid #cfd8e3; border-radius: 8px; height: 44px; cursor: pointer; font-size: 18px; color: var(--danger); }
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.sidebar .card { padding: 16px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 13px; }
.tl { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.tl li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tl li span { color: var(--muted); display: block; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drop { border: 2px dashed #9fb0c5; border-radius: 10px; padding: 12px; background: #fcfeff; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .items-edit .it { grid-template-columns: 1fr 1fr; }
  .paper { padding: 16px 14px; }
  h1 { font-size: 22px; }
  .typed { font-size: 34px; }
}
