:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --surface: #131a20;
  --surface-raised: #202a36;
  --line: #26313d;
  --text: #eef5fb;
  --muted: #aab6c2;
  --accent: #69d7ff;
  --accent-ink: #101820;
  --danger: #db7c84;
  font: 16px/1.5 system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #fff;
  --surface-raised: #e8edf2;
  --line: #d9e0e7;
  --text: #17212b;
  --muted: #526170;
  --accent: #006c88;
  --accent-ink: #fff;
  --danger: #a64e58;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
button, input, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem .9rem; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-raised); color: var(--text);
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary, button.primary { background: #0a7898; border-color: #0a7898; color: white; }
.button.danger, button.danger { color: var(--danger); border-color: var(--danger); }
.button.delete { opacity: .34; }
.container { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 22px 0 48px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 1.25rem; font-weight: 700; }
.brand img { width: 38px; height: 38px; }
.header-actions, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.back { margin: 0 0 14px; }
h1 { font-size: clamp(1.75rem, 5vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
p { margin: .5rem 0 1rem; }
.muted, .small { color: var(--muted); }
.small { font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 14px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-top: 18px; }
.note-card { min-width: 0; overflow: hidden; padding: 0; animation: note-arrive .22s ease-out; }
.note-card a { display: block; background: #000; }
.note-card img { display: block; width: 100%; height: 280px; object-fit: contain; background: #000; }
.note-copy { padding: 12px; overflow-wrap: anywhere; }
.note-copy strong { display: block; margin-bottom: 5px; }
.note-copy .meta { color: var(--muted); font-size: .88rem; }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 24px; color: var(--muted); }
.form-grid { display: grid; gap: 12px; max-width: 680px; }
label { display: grid; gap: 6px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.status { min-height: 1.5em; margin-top: 10px; color: var(--muted); }
.item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 14px 0; }
.item:first-of-type { margin-top: 8px; }
.item-main { min-width: 0; overflow-wrap: anywhere; }
.secret { width: 100%; min-height: 92px; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.danger-card { border-color: color-mix(in srgb, var(--danger), var(--line) 55%); }
.footer { display: flex; flex-wrap: wrap; gap: 14px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 16px; color: var(--muted); }
.info-tip { position: relative; display: inline-block; }
.info-tip summary { display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); list-style: none; cursor: pointer; font-weight: 700; }
.info-tip summary::-webkit-details-marker { display: none; }
.info-tip span { position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 8px); width: min(280px, 80vw); padding: 11px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 8px 24px #0006; font-size: .9rem; font-weight: 400; }
.info-tip:not([open]) span { display: none; }
.login-card { max-width: 620px; margin: 12vh auto 0; }
.login-card .button { min-height: 48px; }
.account-actions { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
@keyframes note-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 540px) {
  .container { width: min(100% - 22px, 1120px); padding-top: 14px; }
  .card { padding: 16px; }
  .header-actions { width: 100%; }
  .header-actions > * { flex: 1; }
  .note-card img { height: 250px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }

.legal-page .container { max-width: 920px; }
.legal-page .card { line-height: 1.65; overflow-wrap: anywhere; }
.legal-page li { margin: .55em 0; }
.legal-page h2 { line-height: 1.3; }
.legal-page section[id] { scroll-margin-top: 24px; }
.legal-toc ol { columns: 2; column-gap: 32px; padding-left: 24px; }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } }

@keyframes legal-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.legal-agreement-slide { animation: legal-slide-in 280ms ease-out; }
@media (prefers-reduced-motion: reduce) { .legal-agreement-slide { animation: none; } }
