/* Linen Notes web editor. Palette shared with the website (Web/site/style.css) and the app's teal theme. No fonts or third parties. */

:root {
  color-scheme: light dark;
  --bg: #eef4f2;
  --bg-top: #f7faf9;
  --glow: #c4e4dd;
  --surface: #ffffff;
  --text: #0d2b27;
  --muted: #4a605b;
  --line: #d5e1de;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --soft: #d9ece8;
  --soft-text: #0b5e57;
  --warn-bg: #fbecd9;
  --warn-text: #5c3a12;
  --danger: #a23b2a;
  --shadow: 0 1px 2px rgb(13 43 39 / 6%), 0 12px 32px rgb(13 43 39 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08110f;
    --bg-top: #0d1a17;
    --glow: #0f2d28;
    --surface: #111c1a;
    --text: #e6efed;
    --muted: #9fb3ae;
    --line: #22332f;
    --accent: #5fd4c3;
    --accent-text: #04201c;
    --soft: #12302b;
    --soft-text: #a7e3d9;
    --warn-bg: #3a2c1c;
    --warn-text: #f3d9b8;
    --danger: #f08a78;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(60rem 26rem at 50% -6rem, var(--glow), transparent), linear-gradient(var(--bg-top), var(--bg) 28rem) var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.75rem 16px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 750; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }

.session { max-width: 52rem; margin: 0 auto; padding: 0 16px; }

main { max-width: 52rem; margin: 0 auto; padding: 0 16px 4rem; outline: none; }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }

a { color: var(--accent); }

button, .button {
  font: inherit;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--danger); }
button:disabled { opacity: 0.55; cursor: default; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type="search"], input[type="text"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

label { display: block; font-weight: 600; margin: 1rem 0 0.25rem; }
.check { display: flex; align-items: center; gap: 0.6rem; font-weight: 400; min-height: 44px; }
.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
.toolbar > .grow { flex: 1 1 14rem; }

.notes { list-style: none; margin: 0.5rem 0; padding: 0; border-top: 1px solid var(--line); }
.notes li { border-bottom: 1px solid var(--line); }
.notes a {
  display: block;
  padding: 0.75rem 0.25rem;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.notes a:hover .row-title { text-decoration: underline; }
.row-title { font-weight: 600; display: block; overflow-wrap: anywhere; }
.row-preview { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 0 0.5rem; }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }

.banner {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}
.banner .toolbar { margin-bottom: 0; }

.status { color: var(--muted); min-height: 1.5em; margin: 0.25rem 0; }
.status.warn { color: var(--warn-text); background: var(--warn-bg); border-radius: 10px; padding: 0.5rem 0.75rem; }

textarea { resize: vertical; line-height: 1.5; }
textarea.title { font-size: 1.4rem; font-weight: 700; min-height: 3rem; }
textarea.body { min-height: 18rem; }
textarea[readonly] { background: transparent; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.25rem 0; }
.tags button { border-radius: 999px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.photos figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface);
  min-height: 6rem; display: flex; align-items: center; justify-content: center; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figcaption { padding: 0.5rem; color: var(--muted); font-size: 0.9rem; text-align: center; }

.other-version { border: 1px dashed var(--line); border-radius: 10px; padding: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); max-width: 32rem; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / 0.4); }

.announce { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (forced-colors: active) {
  button, .button, input, select, textarea, .badge, .banner, .status.warn, .photos figure, .signin summary { border: 1px solid CanvasText; }
  button.primary { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.back { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* Sign-in: one centered card with a single primary action. */

.signin { max-width: 28rem; margin: 2.5rem auto 0; text-align: center; }

.signin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}

.signin-icon { border-radius: 22px; box-shadow: var(--shadow); }

.signin h1 { font-size: clamp(1.75rem, 6vw, 2.2rem); letter-spacing: -0.02em; font-weight: 800; margin: 1rem 0 0.5rem; text-wrap: balance; }

.signin-card > p { color: var(--muted); }

.signin button.primary { width: 100%; min-height: 54px; margin-top: 1.25rem; border-radius: 999px; font-size: 1.05rem; }

.signin .status.warn { text-align: left; margin-top: 1rem; }

.signin .check { justify-content: center; margin: 1rem 0 0; }

.signin-hint { font-size: 0.9rem; }

.signin details { margin-top: 1.25rem; color: var(--muted); }

.signin summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--soft-text);
  background: var(--soft);
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
}

.signin summary::-webkit-details-marker { display: none; }

.signin summary::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}

.signin details[open] summary::after { transform: translateY(15%) rotate(225deg); }

.signin details p { text-align: left; font-size: 0.95rem; }
