/* PhoComp Notizen 1.2.0 */
:root {
  color-scheme: light dark;
  --background: #f5f2fa;
  --surface: #ffffff;
  --text: #272137;
  --muted: #625873;
  --line: #ded7eb;
  --accent: #633da2;
  --accent-ink: #fff;
  --selected: #eee4fb;
  --bar: #37245d;
  --danger: #9a334c;
  --notice: #fff2cf;
  --notice-text: #533710;
  font: 16px/1.5 system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #211a2b;
    --surface: #2c2338;
    --text: #f3ebfa;
    --muted: #c8bad7;
    --line: #4c3e5e;
    --accent: #b694ee;
    --accent-ink: #241237;
    --selected: #453158;
    --bar: #302046;
    --danger: #f5a2b2;
    --notice: #45371b;
    --notice-text: #ffe4ab;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--background); overflow-wrap: anywhere; }
h1, h2, p { margin: 0 0 .65rem; }
a { color: var(--accent); }
input, select, textarea, button { font: inherit; color: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: .58rem; background: var(--surface); }
button { cursor: pointer; padding: .43rem .7rem; min-height: 42px; }
button:hover { background: var(--selected); }
button:disabled { cursor: default; opacity: .6; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
button.primary:hover { filter: brightness(.94); }
input, select, textarea { padding: .56rem .65rem; min-width: 0; width: 100%; }
label { display: block; }
label > input { margin-top: .18rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 750; letter-spacing: .13em; }
.muted, .message { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; padding: clamp(1.25rem, 5vw, 2.6rem); width: min(100%, 430px); box-shadow: 0 12px 48px #1f153011; }
.auth-card h1 { font-size: 2rem; line-height: 1.12; }
.brand-icon { display: block; margin-bottom: 1rem; border-radius: .65rem; }
.auth-card form { display: grid; gap: .8rem; margin: 1.2rem 0 .55rem; }
.auth-card form button { margin-top: .25rem; }
.topbar { background: var(--bar); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.25rem; flex-wrap: wrap; padding: .75rem clamp(.85rem, 3vw, 2rem); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-size: 1.05rem; }
.build-label { color: #f2e5ff; font-size: .72rem; margin-right: auto; }
.top-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.status { font-size: .82rem; padding-right: .2rem; color: #f2e5ff; }
.top-button { background: #ffffff12; color: #fff; border-color: #ffffff45; font-size: .84rem; }
.top-button:hover { background: #ffffff25; }
.data-menu { position: relative; }
.data-menu summary { display: flex; align-items: center; min-height: 42px; padding: .43rem .7rem; border: 1px solid #ffffff45; border-radius: .58rem; cursor: pointer; }
.data-menu summary::after { content: "▾"; margin-left: .4rem; }
.data-menu-items { position: absolute; inset: 100% auto auto 0; z-index: 5; display: grid; gap: .25rem; min-width: 155px; margin-top: .25rem; padding: .4rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); color: var(--text); box-shadow: 0 6px 18px #1f153033; }
.data-menu-items button { text-align: left; white-space: nowrap; }
.notice { margin: 0; padding: .6rem 1rem; background: var(--notice); color: var(--notice-text); }
.layout { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); min-height: calc(100vh - 66px); }
.sidebar { border-right: 1px solid var(--line); }
.sidebar-tools { display: grid; gap: .65rem; padding: 1rem; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.list-head h2 { font-size: 1.22rem; margin: 0; }
.filters { display: grid; gap: .4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters select { font-size: .82rem; }
.text-button { background: transparent; border-color: transparent; color: var(--accent); justify-self: start; }
.text-button[aria-pressed="true"] { background: var(--selected); }
#notes { list-style: none; padding: 0 .55rem; margin: 0; }
.note-card { border: 1px solid var(--line); border-radius: .7rem; margin: 0 0 .55rem; background: var(--surface); }
.note-card-actions { display: flex; gap: .38rem; flex-wrap: wrap; padding: 0 .58rem .55rem; }
.note-card-actions button { min-height: 36px; font-size: .8rem; }
#share-dialog { width: min(92vw, 38rem); border: 1px solid var(--line); border-radius: .8rem; color: var(--text); background: var(--surface); padding: 1rem; }
#share-dialog::backdrop { background: #1f153088; }
#share-dialog button { margin-top: .65rem; }
#print-note { display: none; }
@media print {
  body.printing-note { margin: 0; color: #111; background: #fff; font: 12pt/1.5 sans-serif; }
  body.printing-note > :not(#print-note) { display: none !important; }
  body.printing-note #print-note { display: block; }
  #print-note h1 { font-size: 20pt; }
  #print-body { white-space: pre-wrap; overflow-wrap: anywhere; }
}
.note-row { display: block; text-align: left; width: 100%; padding: .65rem .72rem; margin-bottom: .28rem; background: transparent; border-color: transparent; }
.note-row[aria-current="true"] { background: var(--selected); border-color: var(--line); }
.note-row strong, .note-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row span, #saved { color: var(--muted); font-size: .82rem; }
#no-results { margin: 0 1rem 1rem; }
.writing-pane { padding: clamp(1rem, 4vw, 3rem); background: var(--surface); }
.empty { color: var(--muted); padding: clamp(1rem, 5vw, 4rem) 0; }
.empty h2 { color: var(--text); }
.editor { max-width: 900px; margin: 0 auto; }
.editor-top { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.back { display: none; }
.conflict { color: var(--notice-text); background: var(--notice); border-radius: 2rem; padding: .15rem .6rem; font-size: .78rem; }
.title-input { font-size: clamp(1.5rem, 5vw, 2.6rem); font-weight: 700; padding: .15rem 0; border-color: transparent; }
.location { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; max-width: 35rem; margin: .75rem 0; }
.location label { color: var(--muted); font-size: .88rem; }
.location input { color: var(--text); font-size: 1rem; }
.editor-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin: 1rem 0 .7rem; }
.editor-actions button { font-size: .83rem; }
.editor-actions [aria-pressed="true"] { background: var(--selected); border-color: var(--accent); }
.danger { color: var(--danger); }
textarea { display: block; resize: vertical; min-height: 15rem; background: var(--background); line-height: 1.65; }
.preview { border: 1px solid var(--line); border-radius: .58rem; background: var(--background); padding: .75rem; min-height: 15rem; white-space: pre-wrap; }
.preview label { display: flex; align-items: flex-start; gap: .5rem; }
.preview input { width: 1rem; height: 1rem; margin: .3rem 0 0; flex: 0 0 1rem; accent-color: var(--accent); }
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { border: 0; }
  .writing-pane { display: none; }
  .layout.editing .sidebar { display: none; }
  .layout.editing .writing-pane { display: block; min-height: calc(100vh - 106px); }
  .back { display: inline-block; }
  .data-menu-items { position: static; }
  .topbar { padding-top: max(.45rem, env(safe-area-inset-top)); }
}
