/* ---------- splash / sign-in ---------- */
.splash {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
  background: var(--bg-chrome);
}
.splash-logo {
  width: 72px;
  height: 72px;
}
.splash-title {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 600;
}
.splash-sub {
  max-width: 420px;
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
}
.splash-features {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.splash-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.splash-features .icon {
  color: var(--accent-text);
}
.splash-cta {
  min-height: 40px;
  padding: 0 24px;
  font-size: 15px;
}
.splash-icon {
  color: var(--text-3);
}

/* ---------- table picker ---------- */
.table-picker-wrap {
  padding: 6px 8px;
}
.table-picker-label {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.table-picker {
  display: grid;
  gap: 2px;
}
.table-picker-row {
  display: flex;
  gap: 2px;
}
.table-picker-cell {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--bg-input);
}
.table-picker-cell.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.table-picker-cell:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
}

/* ---------- link and move targets ---------- */
.link-targets,
.move-targets {
  max-height: 240px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-input);
}
.move-targets {
  max-height: 320px;
}
.link-target {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.link-target:hover:not(:disabled) {
  background: var(--bg-hover);
}
.link-target[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.link-target:disabled {
  color: var(--text-3);
}
.link-target-sub {
  margin-left: auto;
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}
.link-target .icon {
  color: var(--text-3);
}

/* ---------- equations ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.eq-snippets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 12px;
}
.eq-snippets .btn {
  min-width: 36px;
  padding: 0 6px;
}
.eq-preview {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-input);
  overflow-x: auto;
  font-size: 18px;
}

/* ---------- templates ---------- */
.templates-cat {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.template-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--bg-input);
  color: var(--text);
  text-align: left;
}
.template-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.template-thumb {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--bg-page);
  color: var(--accent-text);
}
.template-name {
  font-weight: 600;
}
.template-desc {
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- deleted notes ---------- */
.trash-list {
  display: grid;
  max-height: 60vh;
  overflow-y: auto;
}
.trash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-2);
}
.trash-item > .icon:not(.ico) {
  color: var(--text-3);
}
.trash-text {
  flex: 1;
  min-width: 0;
}
.btn.danger:not(.primary) {
  color: var(--danger);
}

/* ---------- immersive reader ---------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  --reader-bg: #fbfbf9;
  --reader-fg: #1d1d1d;
  background: var(--reader-bg);
  color: var(--reader-fg);
}
.reader[data-theme="sepia"] {
  --reader-bg: #f4ecd8;
  --reader-fg: #3b2f20;
}
.reader[data-theme="dark"] {
  --reader-bg: #1c1c1c;
  --reader-fg: #e8e8e8;
}
.reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--reader-fg) 15%, transparent);
}
.reader-bar .icon-btn {
  margin-left: auto;
  color: var(--reader-fg);
}
.reader-title {
  font-weight: 600;
}
.reader-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.reader-opt .select {
  min-height: 28px;
  padding: 2px 6px;
}
.reader-scroll {
  flex: 1;
  overflow-y: auto;
}
.reader-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 120px;
  font-size: var(--reader-size, 26px);
  line-height: 1.7;
  outline: none;
}
.reader[data-font="serif"] .reader-content {
  font-family: Georgia, "Times New Roman", serif;
}
.reader[data-font="mono"] .reader-content {
  font-family: var(--font-mono);
}
.reader.wide-spacing .reader-content {
  letter-spacing: 0.08em;
  word-spacing: 0.25em;
  line-height: 2;
}
.reader-content h1 {
  font-size: 1.4em;
  font-weight: 600;
  margin: 0 0 0.6em;
}
.reader-content p {
  margin: 0 0 0.7em;
}
.reader-foot {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
}
.reader-play {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}
.reader-play:hover {
  background: var(--accent-hover);
}

/* ---------- shortcuts / help / about / share ---------- */
.shortcuts {
  margin-top: 8px;
  max-height: 58vh;
  overflow-y: auto;
}
.shortcuts h3 {
  margin: 14px 0 6px;
  font-size: 13px;
}
.shortcut-table {
  width: 100%;
  border-collapse: collapse;
}
.shortcut-table td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--line-2);
}
.shortcut-table td:last-child {
  text-align: right;
  white-space: nowrap;
}
.help {
  display: grid;
  gap: 14px;
}
.help-tip {
  display: flex;
  gap: 12px;
}
.help-tip .icon {
  flex: none;
  margin-top: 2px;
  color: var(--accent-text);
}
.help-tip p {
  margin: 2px 0 0;
  color: var(--text-2);
  line-height: 1.5;
}
.about {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.about p {
  margin: 0;
  line-height: 1.5;
}
.share-head {
  margin: 4px 0 6px;
  font-size: 13px;
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.share-row .input {
  flex: 1;
  min-width: 180px;
}
.share-row .select {
  width: auto;
}
.file-tab {
  height: 100%;
}
.font-menu,
.size-menu {
  max-height: 340px;
}

/* ---------- shared view ---------- */
.shared-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.shared-view .main {
  flex: 1;
  min-height: 0;
}
