/* Online Notebook — 2026 refresh. Blue canvas + yellow legal pad. */
:root {
  --canvas: #4fbde9;
  --canvas-dark: #2a9fd0;
  --ink: #1d2b3a;
  --ink-soft: #4a5868;
  --muted: #6b7785;
  --card: #ffffff;
  --line: #dbe3ec;
  --brand: #1b335e;
  --brand-2: #24508f;
  --accent: #f59e0b;
  --paper: #fbf193;
  --paper-rule: #d8cd72;
  --paper-margin: #e7a1a1;
  --leather: #262626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(10, 50, 80, .18);
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --hand: 'Andika', 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.6 var(--ui);
  color: var(--ink);
  background: var(--canvas) url('canvas-blue.png') repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--brand-2); }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: #fff; padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header { background: #13284a; box-shadow: 0 2px 12px rgba(0, 40, 70, .25); position: relative; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand img { display: block; width: 200px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: #d6e3f3; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.site-nav a[aria-current="page"] { background: #ffd447; color: #13284a; }

/* ---------- intro / headings ---------- */
.intro { text-align: center; color: #fff; padding: 26px 0 6px; }
.intro h1 { margin: 0; font-size: clamp(28px, 4.4vw, 42px); line-height: 1.15; font-weight: 800; text-shadow: 0 2px 10px rgba(0, 60, 100, .25); }
.intro h1 span { display: block; font-size: clamp(15px, 2vw, 18px); font-weight: 600; opacity: .95; margin-top: 6px; }
.intro h1 span a { color: #fff; }
.intro .h-note { font-size: clamp(24px, 3.4vw, 32px); }
.intro p.lead { margin: 8px auto 0; max-width: 700px; font-size: 18px; font-weight: 600; }
.notice { background: #fff8db; border: 1px solid #f3d36b; border-radius: 10px; padding: 10px 14px; margin: 16px 0 0; }

/* ---------- address bar ---------- */
.addr { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 18px 0 14px; }
.addr-label { display: block; font-weight: 700; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.addr-field { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7fafc; }
.addr-field:focus-within { border-color: var(--brand-2); }
.addr-host { display: flex; align-items: center; padding: 0 2px 0 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.addr-field input { flex: 1; min-width: 0; border: 0; background: transparent; font: 700 18px var(--ui); color: var(--brand); padding: 10px 6px; outline: none; }
.addr-field input.invalid { color: #c0392b; }
.addr-field .btn { border-radius: 0; border-left: 2px solid var(--line); }
.addr-help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.addr-help.err { color: #c0392b; font-weight: 700; }
.recent { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.recent a { display: inline-block; margin: 2px 0 2px 8px; padding: 1px 10px; border-radius: 999px; background: #eef5fb; text-decoration: none; font-weight: 700; }

/* ---------- buttons ---------- */
.btn { font: 700 15px var(--ui); border: 0; border-radius: 9px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-light { background: #eef3f8; color: var(--brand); }
.btn-light:hover { background: #e1eaf3; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-danger { background: #c0392b; color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

/* ---------- banner ---------- */
.banner { background: #fff8db; border: 2px solid #f3c44b; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.banner p { margin: 0 0 8px; }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- the yellow pad ---------- */
.pad { border-radius: 10px; box-shadow: var(--shadow), 0 2px 0 #c9bd57; overflow: hidden; background: var(--paper); }
.pad-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 6px 10px 6px 16px;
  background:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.4px) 0 0 / 5px 5px,
    radial-gradient(rgba(0,0,0,.25) 1px, transparent 1.4px) 2px 3px / 6px 6px,
    linear-gradient(#333, var(--leather));
  border-bottom: 3px solid #141414;
}
.pad-status { color: #d8d8d8; font-style: italic; font-size: 14px; min-width: 60px; }
.pad-status.is-saved { color: #b7f0a5; }
.pad-status.is-error { color: #ffb4a8; font-style: normal; font-weight: 700; }
.pad-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); color: #eee; border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: 6px 10px; font: 700 13px var(--ui); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pad-text {
  display: block; width: 100%; height: min(58vh, 540px); min-height: 260px; resize: vertical; border: 0; outline: none; margin: 0;
  padding: 4px 20px 32px 72px;
  font: 19px/32px var(--hand); color: #1f2a37;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 54px, var(--paper-margin) 54px, var(--paper-margin) 55px, transparent 55px, transparent 58px, var(--paper-margin) 58px, var(--paper-margin) 59px, transparent 59px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 31px, var(--paper-rule) 32px);
  background-position: 0 0, 0 4px;
  background-attachment: local;
  caret-color: #b91c1c;
}
.pad-text::placeholder { color: #8a8253; font-style: italic; }
.pad-text[readonly] { cursor: text; }
.pad-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 14px; background: #f1e57b; border-top: 1px solid #e0d36a; font-size: 13px; color: #6b6230; font-weight: 600; }

/* full screen writing mode */
body.fs { overflow: hidden; }
body.fs .pad { position: fixed; inset: 0; z-index: 50; border-radius: 0; display: flex; flex-direction: column; }
body.fs .pad-text { flex: 1; height: auto; resize: none; padding-left: max(72px, calc(50vw - 420px)); padding-right: max(20px, calc(50vw - 480px));
  background-image:
    linear-gradient(to right, transparent calc(max(72px, calc(50vw - 420px)) - 18px), var(--paper-margin) 0, var(--paper-margin) calc(max(72px, calc(50vw - 420px)) - 17px), transparent 0),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 31px, var(--paper-rule) 32px); }

/* ---------- tools (chips) ---------- */
.tools { background: #e8eef6; border-radius: var(--radius); padding: 12px; margin: 14px 0; box-shadow: 0 4px 16px rgba(10, 50, 80, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-small { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #c9d5e3; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #dfe6ee; border-radius: 8px;
  padding: 7px 12px 7px 7px; font: 600 16px var(--ui); color: var(--ink); cursor: pointer; transition: transform .08s, box-shadow .15s;
}
.chip:hover { box-shadow: 0 3px 10px rgba(20, 60, 100, .15); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip-sm { padding: 6px 12px; font-size: 14px; color: var(--ink-soft); }
.badge { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 4px; border-radius: 5px; font: 700 15px var(--ui); }
.c-orange { background: #fde7dc; color: #e2581b; }
.c-green { background: #e6f6d9; color: #4c9a16; }
.c-cyan { background: #dcf4fb; color: #0c8db3; }
.c-purple { background: #f0e2fb; color: #9333ea; }
.c-yellow { background: #fdf6c9; color: #b88a00; }
.c-teal { background: #d9f7ec; color: #0e9f6e; }
.c-pink { background: #fde0f0; color: #d1188b; }
.c-blue { background: #dfe8fb; color: #2f5fd0; }
.tools-help { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.findbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 10px; padding: 10px; background: #fff; border-radius: 10px; border: 1px solid #dfe6ee; }
.findbar label { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--ink-soft); flex: 1 1 160px; }
.findbar label.check { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; padding-bottom: 10px; }
.findbar input[type=text] { font: 16px var(--ui); padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; margin-top: 3px; }

/* ---------- share links ---------- */
.share { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 14px 0; }
.share h2 { margin: 0 0 10px; font-size: 19px; }
.share p { margin: 4px 0; }
.link-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.link-kind { flex: 0 0 92px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.kind-edit { color: #b45309; }
.kind-view { color: #047857; }
.link-row input { flex: 1; min-width: 0; font: 600 15px var(--ui); color: var(--brand); padding: 9px 10px; border: 2px solid var(--line); border-radius: 8px; background: #f7fafc; }
.share-more { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }

/* ---------- ads ---------- */
.ad-slot { margin: 18px auto; min-height: 100px; text-align: center; }

/* ---------- content (SEO) ---------- */
.content { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 26px 18px; margin: 18px 0 28px; }
.content h2 { font-size: 24px; margin: 22px 0 8px; color: var(--brand); line-height: 1.25; }
.content h3 { font-size: 19px; margin: 18px 0 6px; }
.content p, .content li { color: #2f3d4c; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.features { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.features li { background: #f6f9fc; border: 1px solid #e3eaf2; border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.features li b { display: block; color: var(--brand); font-size: 16px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.promo { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-decoration: none; color: var(--ink); background: #f6f9fc; border: 1px solid #e3eaf2; border-radius: 12px; padding: 14px; }
.promo:hover { border-color: var(--brand-2); }
.promo .badge { grid-row: span 2; width: 44px; height: 44px; font-size: 18px; }
.promo span:last-child { font-size: 14px; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; color: var(--ink); list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: -2px; font-size: 22px; color: var(--brand-2); }
.faq details[open] summary::after { content: '–'; }
.faq details div { padding: 6px 0 2px; color: #2f3d4c; }
.table-wrap { overflow-x: auto; }
.example { width: 100%; border-collapse: collapse; font-size: 15px; }
.example th, .example td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.example th { background: #f6f9fc; }
.prose { color: #2f3d4c; }
.prose h1 { font-size: 28px; color: var(--brand); }
.prose h1, .prose h2 { line-height: 1.25; }

/* ---------- tool pages ---------- */
.tool-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 18px 0 0; }
.tool-box .tool-text {
  display: block; width: 100%; height: min(46vh, 420px); min-height: 220px; resize: vertical; border: 0; outline: none;
  padding: 16px 18px; font: 17px/1.6 var(--ui); color: var(--ink); background: #fff;
}
.tool-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #f6f9fc; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); font-weight: 600; }
.tool-bar .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-bar .btn { padding: 7px 12px; font-size: 14px; }
.options { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 2px 0; font-size: 14px; }
.options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.big-chip .chip { font-size: 17px; }

/* ---------- history ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin: 18px 0; }
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev-list li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rev-list .rev-when { font-weight: 800; color: var(--brand); white-space: nowrap; }
.rev-list .rev-prev { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.rev-list .rev-meta { flex: 1; min-width: 0; }

/* ---------- forms ---------- */
.form-row { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.form-row label { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.form-row input, .form-row textarea { font: 16px var(--ui); padding: 10px 12px; border: 2px solid var(--line); border-radius: 9px; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-weight: 600; }
.alert-ok { background: #e7f8ee; color: #116b3a; border: 1px solid #b6e6c8; }
.alert-err { background: #fdecea; color: #a12a1d; border: 1px solid #f5c2bc; }

/* ---------- footer ---------- */
.site-footer { background: #13284a; color: #c9d6e8; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; padding-top: 26px; padding-bottom: 12px; }
.footer-grid h2 { color: #fff; font-size: 15px; margin: 4px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 4px 0; }
.footer-grid img { filter: brightness(1.05); }
.footer-grid p { font-size: 14px; margin: 8px 0; }
.site-footer a { color: #fff; }
.footer-base { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; padding-bottom: 18px; font-size: 14px; }
.footer-base p { margin: 0; }
.share-row a { margin-left: 8px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 100;
  background: #13284a; color: #fff; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); font-weight: 700; font-size: 15px; transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: #ffd447; color: #13284a; border: 0; border-radius: 8px; padding: 5px 12px; font: 800 14px var(--ui); cursor: pointer; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .brand img { width: 170px; }
  .header-row { justify-content: center; }
  .site-nav { justify-content: center; }
  .site-nav a { font-size: 14px; padding: 6px 10px; }
  .icon-btn span { display: none; }
  .pad-text { padding-left: 48px; font-size: 18px; background-image:
    linear-gradient(to right, transparent 34px, var(--paper-margin) 34px, var(--paper-margin) 35px, transparent 35px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 31px, var(--paper-rule) 32px); }
  .chip { font-size: 15px; }
  .content { padding: 4px 16px 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .link-row { flex-wrap: wrap; }
  .link-kind { flex-basis: 100%; }
  .addr-host { font-size: 14px; }
}
@media print {
  .site-header, .site-footer, .addr, .tools, .share, .ad-slot, .content, .pad-top, .pad-foot, .intro { display: none !important; }
  .pad { box-shadow: none; }
  .pad-text { height: auto; background: none; }
}
