:root {
  --paper: #f6f3ef;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --ink: #1f2937;
  --ink-soft: #475569;
  --line: rgba(148, 163, 184, 0.28);
  --shadow: rgba(15, 23, 42, 0.08);
  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.1);
  --success: #0f9f6e;
  --warning: #c084fc;
  --danger: #dc2626;
  --muted: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f4efe9 0%, #f7f2ee 100%);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f2efe9 0%, #f7f4ef 100%);
  color: var(--ink);
}

body.overflow-hidden {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  margin: 0;
  box-sizing: border-box;
}

button {
  cursor: pointer;
}

button,
input,
select,
textarea,
optgroup {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.1rem;
}

.panel {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  border-radius: 24px;
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  height: calc(100vh - 2rem);
  padding: 1.1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.2rem 0 1rem;
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-copy {
  flex: 1;
  min-width: 0;
}

.brand-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(234, 240, 247, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -8px 16px rgba(15, 23, 42, 0.025), 0 12px 22px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-actions::before {
  content: "";
  position: absolute;
  inset: 0.28rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(148, 163, 184, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 2px 7px rgba(255, 255, 255, 0.72), inset 0 -2px 7px rgba(148, 163, 184, 0.14);
  pointer-events: none;
}

.help-button,
.deep-research-button,
.stanza-button,
.reminder-button,
.tag-button,
.vault-button,
.brand-action-button {
  position: relative;
  z-index: 1;
  flex: 1 1 3.2rem;
  min-width: 3.2rem;
  max-width: 3.8rem;
  height: 3.2rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 243, 249, 0.82));
  color: var(--primary);
  font-size: 1.34rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0.02em;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -5px 10px rgba(15, 23, 42, 0.04), 0 8px 18px rgba(15, 23, 42, 0.06);
}

.brand-action-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.brand-action-icon circle,
.brand-action-icon path,
.brand-action-icon rect,
.brand-action-icon line,
.brand-action-icon polyline {
  vector-effect: non-scaling-stroke;
}

.help-button::before,
.deep-research-button::before,
.stanza-button::before,
.reminder-button::before,
.tag-button::before,
.vault-button::before,
.brand-action-button::before {
  content: "";
  position: absolute;
  inset: 0.18rem 0.28rem auto;
  height: 0.75rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.brand-action-button {
  flex: 1 1 4.8rem;
  min-width: 4.8rem;
  max-width: 6rem;
  padding: 0 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-save-backup-button {
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.72));
  color: #0f766e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(16, 185, 129, 0.1);
}

.brand-import-backup-button {
  border-color: rgba(14, 165, 233, 0.2);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.12), rgba(255, 255, 255, 0.72));
  color: #0369a1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(14, 165, 233, 0.1);
}

.deep-research-button {
  border-color: rgba(14, 165, 233, 0.24);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(255, 255, 255, 0.72));
  color: #0369a1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(14, 165, 233, 0.12);
}

.stanza-button {
  border-color: rgba(16, 185, 129, 0.22);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(255, 255, 255, 0.72));
  color: #0f766e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(16, 185, 129, 0.1);
}

.reminder-button {
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.17), rgba(255, 255, 255, 0.72));
  color: #b45309;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(245, 158, 11, 0.12);
}

.tag-button {
  border-color: rgba(14, 165, 233, 0.22);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.14), rgba(255, 255, 255, 0.72));
  color: #0369a1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(14, 165, 233, 0.1);
  font-size: 1rem;
}

.vault-button {
  border-color: rgba(168, 85, 247, 0.22);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.18), rgba(255, 255, 255, 0.72));
  color: #6d28d9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(168, 85, 247, 0.12);
}

.help-button:hover,
.deep-research-button:hover,
.stanza-button:hover,
.reminder-button:hover,
.tag-button:hover,
.vault-button:hover,
.brand-action-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -4px 8px rgba(15, 23, 42, 0.05), 0 10px 18px rgba(15, 23, 42, 0.08);
}

.brand-save-backup-button:hover {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.16), rgba(255, 255, 255, 0.72));
}

.brand-import-backup-button:hover {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(255, 255, 255, 0.72));
}

.deep-research-button:hover {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(255, 255, 255, 0.72));
}

.stanza-button:hover {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), rgba(255, 255, 255, 0.72));
}

.reminder-button:hover {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.2), rgba(255, 255, 255, 0.72));
}

.tag-button:hover {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(255, 255, 255, 0.72));
}

.vault-button:hover {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.2), rgba(255, 255, 255, 0.72));
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.reminder-modal-quote {
  display: block;
  min-height: 1.6em;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.reminder-modal-quote.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reminder-modal-quote.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}

.deep-research-quote {
  display: block;
  min-height: 1.6em;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
  white-space: normal;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.deep-research-quote.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.deep-research-quote.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}

.brand-row h1,
.topbar h2 {
  margin: 0.2rem 0 0;
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 2.5vw, 2.5rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
  white-space: nowrap;
}

.sidebar-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  flex: 1 1 auto;
}

.sidebar-active-trunk-graph {
  margin: 0 0 0.6rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.sidebar-section .section-header {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

#diarySidebarLabel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section .diary-header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.diary-header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.diary-header-controls > .chip-button {
  flex: 1 1 0;
  width: 100%;
}

#toggleDiaryToolbarBtn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#toggleDiaryToolbarBtn:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.08);
}

#toggleDiaryToolbarBtn:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.7);
  outline-offset: 2px;
}

#toggleDiaryToolbarBtn::after {
  content: '▾';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
  font-size: 0.9rem;
  color: var(--primary);
}

#toggleDiaryToolbarBtn[aria-expanded='false']::after {
  transform: rotate(-90deg);
}

.diary-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diary-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease, padding 0.2s ease;
  max-height: 200px;
  opacity: 1;
  overflow: hidden;
}

.diary-toolbar.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.diary-toolbar input,
.diary-toolbar select {
  flex: 1 1 120px;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  font-size: 0.78rem;
}

.section-header-tight {
  margin-bottom: 1rem;
}

.chip-button,
.primary-button,
.muted-button,
.ghost-button,
.danger-button,
.diary-row button,
.entry-card button,
.diary-form button {
  border: 1px solid transparent;
  border-radius: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.chip-button {
  padding: 0.5rem 0.8rem;
  border-color: rgba(79, 70, 229, 0.18);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.chip-button:hover,
.primary-button:hover,
.ghost-button:hover,
.muted-button:hover,
.danger-button:hover,
.diary-row button:hover,
.entry-card button:hover,
.diary-form button:hover {
  transform: translateY(-1px);
}

.diary-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  min-height: 0;
  max-height: 100%;
  height: 0;
  flex: 1 1 0;
  overscroll-behavior: contain;
}

.diary-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(248, 250, 252, 0.9);
  text-align: left;
  min-width: 0;
  flex-shrink: 0;
  overflow: hidden;
  min-height: 225px;
  height: auto;
}

.diary-row.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(125, 86, 242, 0.06));
  border-color: rgba(79, 70, 229, 0.22);
}

.diary-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  width: 100%;
  order: 1;
}

.diary-activity-graph-wrap {
  display: grid;
  gap: 0.45rem;
  order: 2;
}

.diary-activity-graph {
  position: relative;
  width: 100%;
  height: 3.2rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04), rgba(148, 163, 184, 0.02));
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
  margin-bottom: 0.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 0.35rem 0.4rem 0.2rem;
}

.diary-activity-day-labels {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1rem;
  pointer-events: none;
}

.diary-activity-graph svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(100% - 0.7rem);
  display: block;
  margin-top: 0.45rem;
}

.diary-activity-graph svg rect {
  cursor: help;
  shape-rendering: crispEdges;
}

.diary-activity-day-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: inline-block;
  min-width: 0.9rem;
  padding: 0.1rem 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: rgba(51, 65, 85, 0.82);
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.diary-activity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding: 0 0.15rem 0.05rem;
}

.diary-activity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--muted);
}

.diary-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.diary-copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.diary-copy strong,
.diary-copy span {
  display: block;
}

.diary-copy strong {
  font-size: 0.94rem;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.diary-copy span {
  margin-top: 0.18rem;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.diary-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  order: 3;
}

.diary-actions button {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.diary-color-trigger {
  position: relative;
}

.diary-color-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.diary-color-menu-panel {
  position: absolute;
  left: var(--picker-left, 12px);
  top: var(--picker-top, 12px);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 180px;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
}

.diary-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.diary-color-swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45);
  cursor: pointer;
}

.diary-custom-color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diary-custom-color-field input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.diary-color-set-button {
  border: 1px solid rgba(79, 70, 229, 0.2);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(167, 139, 250, 0.16));
  color: var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.diary-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.diary-field {
  display: grid;
  gap: 0.35rem;
}

.diary-form input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
}

.diary-form input.is-valid {
  border-color: rgba(15, 159, 110, 0.6);
  background: rgba(15, 159, 110, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 159, 110, 0.12);
}

.diary-form input.is-invalid {
  border-color: rgba(220, 38, 38, 0.6);
  background: rgba(220, 38, 38, 0.05);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.diary-field-error {
  min-height: 1rem;
  color: var(--danger);
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.diary-field-error:not(:empty) {
  opacity: 1;
}

.diary-form button,
.primary-button,
.ghost-button,
.muted-button,
.danger-button {
  padding: 0.8rem 1rem;
  font-weight: 700;
}

.diary-form button,
.primary-button {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(79, 70, 229, 0.28);
}

.diary-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-button:disabled,
.primary-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.main-panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  min-width: 220px;
  text-align: right;
}

.topbar-clock-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-clock-readout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.14);
  background: rgba(79, 70, 229, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.topbar-user-button {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(168, 85, 247, 0.16));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 22px rgba(79, 70, 229, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topbar-user-button:hover,
.topbar-user-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 26px rgba(79, 70, 229, 0.18);
  outline: none;
}

.topbar-user-button-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ghost-button,
.muted-button {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.file-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.stats-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.stats-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stats-filter-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(129, 140, 248, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.date-range-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.date-range-preset {
  border: 1px solid rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.date-range-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
}

.date-range-preset.is-active {
  border-color: rgba(79, 70, 229, 0.28);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(99, 102, 241, 0.12));
  color: var(--primary);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.date-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.date-range-field {
  gap: 0.45rem;
  padding: 0.9rem 0.9rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
}

.date-range-field span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.date-range-input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.date-range-input:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.36);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: -0.05em;
  color: var(--ink);
}

.content-grid {
  --form-panel-width: 390px;
  display: grid;
  grid-template-columns: minmax(260px, var(--form-panel-width)) 1rem minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.form-panel,
.entries-panel {
  min-width: 0;
  padding: 1.15rem 1.1rem;
}

.form-panel {
  grid-column: 1;
  position: sticky;
  top: 1rem;
  transition: width 0.25s ease, max-width 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.entries-panel {
  grid-column: 3;
}

.content-grid-resizer {
  grid-column: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.content-grid-resizer::before {
  content: "";
  display: block;
  width: 0.42rem;
  height: 4.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.9), rgba(148, 163, 184, 0.7));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.15);
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.content-grid-resizer:hover::before,
.content-grid-resizer:focus-visible::before,
.content-grid-resizer.is-dragging::before {
  opacity: 1;
  transform: scaleX(1.2);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.72), 0 0 0 1px rgba(99, 102, 241, 0.24), 0 8px 20px rgba(79, 70, 229, 0.18);
}

.content-grid-resizer:focus-visible {
  outline: none;
}

.form-panel.is-fullscreen {
  position: fixed;
  inset: 1rem;
  z-index: 40;
  max-width: none;
  width: calc(100vw - 2rem);
  height: calc(100vh - 2rem);
  overflow: auto;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.diary-form input,
.diary-form textarea,
.diary-form select,
.entry-form input,
.entry-form textarea,
.entry-form select,
.toolbar-inline input,
.toolbar-inline select,
#diaryNameInput,
#entryTitle,
#entryTags,
#entryNotes,
#entryDate,
#entryStartedAt,
#entryEndedAt,
#entryDuration {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--ink);
  padding: 0.72rem 0.8rem;
  margin: 0;
}

.diary-form input:focus,
.diary-form textarea:focus,
.diary-form select:focus,
.entry-form input:focus,
.entry-form textarea:focus,
.entry-form select:focus,
.toolbar-inline input:focus,
.toolbar-inline select:focus,
#diaryNameInput:focus,
#entryTitle:focus,
#entryTags:focus,
#entryNotes:focus,
#entryDate:focus,
#entryStartedAt:focus,
#entryEndedAt:focus,
#entryDuration:focus {
  outline: 2px solid rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.45);
}

textarea,
#entryNotes {
  resize: vertical;
  min-height: 120px;
}

.field-row {
  display: grid;
  gap: 0.8rem;
}

.field-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-row-1 {
  grid-template-columns: 1fr;
}

.total-row {
  margin-top: -0.15rem;
}

.total-time-readout {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(79, 70, 229, 0.2);
  background: rgba(79, 70, 229, 0.06);
  border-radius: 14px;
  padding: 0.72rem 0.8rem;
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
}

.time-log-section,
.timer-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(248, 250, 252, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.time-log-header,
.timer-header {
  margin-top: 0.05rem;
}

.time-log-toggle,
.timer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.time-log-toggle:hover,
.timer-toggle:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.08);
}

.time-log-toggle:focus-visible,
.timer-toggle:focus-visible,
.time-log-add-btn:focus-visible,
.timer-add-btn:focus-visible,
.time-log-remove:focus-visible,
.timer-remove:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.7);
  outline-offset: 2px;
}

.time-log-toggle-label,
.timer-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.time-log-toggle-icon,
.timer-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
}

.time-log-toggle-indicator,
.timer-toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
  font-size: 0.9rem;
  color: var(--primary);
}

.time-log-section.is-collapsed .time-log-toggle-indicator,
.timer-section.is-collapsed .timer-toggle-indicator {
  transform: rotate(-90deg);
}

.time-log-section-actions,
.timer-section-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 0;
}

.time-log-add-btn,
.timer-add-btn {
  display: none;
}

.time-log-section:not(.is-collapsed) .time-log-add-btn,
.timer-section:not(.is-collapsed) .timer-add-btn {
  display: inline-flex;
}

.time-log-list,
.timer-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.time-log-row,
.timer-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.7);
  padding: 0.7rem 0.75rem;
}

.time-log-row.is-auto,
.timer-row.is-auto {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(236, 253, 245, 0.92);
}

.time-log-row-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.time-log-row-summary-collapsed,
.time-log-row-summary-expanded {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
}

.time-log-row-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
}

.time-log-row-summary-time {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--primary);
}

.time-log-row-summary-note {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-log-row-summary-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.time-log-row-summary-caret {
  font-size: 0.9rem;
  color: var(--primary);
  transition: transform 0.18s ease;
}

.time-log-row-summary:not(.is-collapsed) .time-log-row-summary-collapsed,
.time-log-row-summary.is-collapsed .time-log-row-summary-expanded {
  display: none;
}

.time-log-row.is-collapsed .time-log-row-summary-caret {
  transform: rotate(-90deg);
}

.time-log-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.time-log-row.is-collapsed .time-log-row-content {
  display: none;
}

.time-log-row-note,
.timer-row-note {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-log-row-note textarea,
.time-log-row-note input,
.timer-row-note input {
  width: 100%;
  min-height: 84px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  resize: vertical;
}

.time-log-row-duration,
.timer-row-duration {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: -0.12rem;
  margin-bottom: 0.1rem;
}

.time-log-row-status,
.timer-row-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #065f46;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-log-section.is-collapsed .time-log-list,
.time-log-section.is-collapsed .time-log-section-actions,
.timer-section.is-collapsed .timer-list,
.timer-section.is-collapsed .timer-section-actions {
  display: none;
}

.time-log-row .field-row,
.timer-row .field-row {
  margin: 0;
}

.timer-reference-btn,
.time-log-reference-btn,
.timer-remove {
  align-self: flex-end;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
}

.time-log-reference-btn,
.timer-reference-btn {
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.08);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.review-dialog {
  width: min(1120px, 100%);
}

.review-subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.review-stage {
  position: relative;
  min-height: 420px;
  margin-top: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.review-stage-viewport {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 420px;
}

.review-layer {
  position: relative;
  min-height: 420px;
  overflow: auto;
  padding: 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(248, 250, 252, 0.95));
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.review-layer:last-child {
  border-right: 0;
}

.review-layer.is-animating {
  animation: reviewLayerPulse 0.28s ease;
}

@keyframes reviewLayerPulse {
  0% {
    filter: brightness(0.99);
  }
  50% {
    filter: brightness(1.02);
  }
  100% {
    filter: brightness(1);
  }
}

.review-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.review-panel-body {
  flex: 1;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(248, 250, 252, 0.95));
}

.review-editorial-body {
  display: grid;
  gap: 1.1rem;
  padding: 1.1rem;
  color: var(--ink);
}

.review-toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
}

.review-toggle-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.review-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 2.7rem;
  height: 1.45rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
  transition: background 0.28s ease, box-shadow 0.28s ease;
}

.review-toggle-knob {
  position: relative;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: transform 0.28s ease;
}

.review-toggle.is-on .review-toggle-track {
  background: rgba(79, 70, 229, 0.25);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.26);
}

.review-toggle.is-on .review-toggle-knob {
  transform: translateX(1.25rem);
}

.review-summary-bar {
  display: flex;
  justify-content: flex-start;
}

.review-summary-pill {
  display: inline-flex;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-summary-pill.is-original {
  background: rgba(148, 163, 184, 0.12);
  color: var(--ink-soft);
}

.review-summary-pill.is-current {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.review-meta-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.review-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--ink);
}

.review-meta-item.is-changed {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.42);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.15) inset;
}

.review-stage.is-diff-hidden .review-meta-item.is-changed {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.review-meta-label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-meta-value {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-notes-panel {
  display: grid;
  gap: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.8rem;
}

.review-notes-label {
  display: inline-block;
}

.review-notes-copy {
  display: grid;
  gap: 0.5rem;
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.review-sentence {
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.review-sentence.is-changed {
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: var(--ink);
}

.review-stage.is-diff-hidden .review-sentence.is-changed,
.review-stage.is-diff-hidden .review-meta-item.is-changed {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: inherit;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.danger-button {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: #991b1b;
}

.entry-card.is-editing .entry-actions button:disabled,
.entry-card.is-editing .entry-actions button[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.5;
}

.status-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-message:empty {
  display: none;
}

.status-message[data-tone='success'] {
  color: var(--success);
}

.status-message[data-tone='warning'] {
  color: #8b5cf6;
}

.status-message[data-tone='error'] {
  color: var(--danger);
}

.toolbar-inline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.toolbar-inline input,
.toolbar-inline select {
  min-width: 150px;
  max-width: 180px;
}

.sticky-pins-toggle,
.time-log-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.sticky-pins-toggle .review-toggle,
.time-log-toggle .review-toggle {
  margin: 0;
}

body.reference-highlights-disabled .entry-time-log-reference {
  display: none !important;
}

.entry-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 0.2rem;
  container-type: inline-size;
}

.entry-card {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.96));
  padding: 1.05rem 1rem 0.95rem;
  min-width: 0;
  transition: filter 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.entry-card.is-editing {
  opacity: 0.66;
  filter: grayscale(0.9) blur(0.2px) saturate(0.7);
  border-color: rgba(148, 163, 184, 0.3);
}

.entry-card.is-pinned {
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.entry-card:hover {
  border-color: rgba(79, 70, 229, 0.2);
}

.entry-pin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(79, 70, 229, 0.12);
  color: rgba(79, 70, 229, 0.95);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-meta-secondary-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entry-card-editing-indicator {
  position: absolute;
  inset: 0.8rem 0.8rem auto auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: entry-editing-fade 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes entry-editing-fade {
  0%, 100% {
    opacity: 0;
    transform: translateY(-2px);
  }
  25%, 75% {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-card-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.entry-card-main {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.entry-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.45rem;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
  flex-shrink: 0;
}

.entry-copy {
  min-width: 0;
  flex: 1;
}

.entry-copy h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--ink);
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-meta {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-meta > div + div {
  margin-top: 0.12rem;
}

.entry-meta-secondary {
  color: var(--muted);
}

.entry-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

@container (max-width: 520px) {
  .entry-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-card-main {
    order: 2;
  }

  .entry-actions {
    order: 1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.entry-actions button {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--muted);
  padding: 0.46rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.linked-entries-section {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.linked-entries-section.is-collapsed .linked-entries-list {
  display: none;
}

.linked-entries-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.linked-entries-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
}

.linked-entries-arrow {
  font-size: 0.85rem;
  line-height: 1;
}

.linked-entries-list {
  display: grid;
  gap: 0.7rem;
}

.entry-notes-wrap {
  margin-top: 0.8rem;
}

.entry-note {
  user-select: text;
  -webkit-user-select: text;
}

.entry-time-log-reference,
.entry-time-log-reference * {
  user-select: none;
  -webkit-user-select: none;
}

.entry-notes {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.entry-notes > *:first-child {
  margin-top: 0;
}

.entry-notes > *:last-child {
  margin-bottom: 0;
}

.entry-notes h1,
.entry-notes h2,
.entry-notes h3 {
  margin: 0.8rem 0 0.5rem;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.entry-notes h1 {
  font-size: 1.25rem;
}

.entry-notes h2 {
  font-size: 1.1rem;
}

.entry-notes h3 {
  font-size: 1rem;
}

.entry-notes p,
.entry-notes ul,
.entry-notes ol {
  margin: 0 0 0.75rem;
}

.entry-notes ul,
.entry-notes ol {
  padding-left: 1.2rem;
}

.entry-notes li + li {
  margin-top: 0.28rem;
}

.entry-time-log-reference {
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  margin: 1rem 0 1rem 0rem;
  padding: 0.7rem 0.9rem 0.7rem 0.7rem;
  border: 1px solid rgba(250, 204, 21, 0.78);
  border-left: 1px solid rgba(250, 204, 21, 0.95);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.52), rgba(255, 255, 255, 0.86));
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.12);
}

.entry-time-log-reference-margin {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 3.1rem;
  padding-right: 0.2rem;
  border-right: 1px solid rgba(250, 204, 21, 0.45);
  color: rgba(120, 77, 0, 0.9);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

.entry-time-log-reference-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.entry-time-log-reference-header {
  color: rgba(120, 77, 0, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-time-log-reference-copy {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.7;
}

.entry-notes a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.entry-notes strong {
  color: var(--ink);
}

.entry-notes u {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.14em;
}

.entry-notes.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.entry-notes.is-expanded {
  display: block;
  max-height: none;
  overflow: visible;
  white-space: normal;
}

.entry-notes-empty {
  margin: 0;
  color: var(--muted);
}

.entry-notes-toggle {
  margin-top: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.entry-notes-toggle:hover {
  text-decoration: underline;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.entry-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.tag-toolbar {
  margin: 0.7rem 0 1rem;
}

.tag-toolbar input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
  color: var(--ink);
}

.tag-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.tag-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.tag-row:hover {
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.06);
}

.tag-row.is-editing {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.38);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.08);
}

.project-service-type-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.inline-link-button {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12rem;
}

.inline-link-button:hover,
.inline-link-button:focus-visible {
  color: #312e81;
  outline: none;
}

.tag-copy {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.tag-name {
  font-weight: 900;
  color: var(--ink);
  word-break: break-word;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.tag-copy small,
.tag-copy p {
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.tag-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  font-size: 0.7rem;
  font-weight: 800;
}

.tag-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tag-open,
.tag-edit,
.tag-delete {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.tag-open,
.tag-edit {
  color: var(--primary);
}

.tag-delete {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.2);
}

.tag-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.tag-field-grid {
  display: grid;
  gap: 0.9rem;
}

.tag-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 600;
}

.tag-form input,
.tag-form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.task-service-type-field {
  position: relative;
}

.task-service-type-shell {
  position: relative;
}

.task-service-type-shell .tag-suggestions {
  top: calc(100% + 0.42rem);
}

.tag-form input:focus,
.tag-form textarea:focus {
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.tag-field {
  display: block;
}

.tag-input-shell {
  position: relative;
  margin-top: 0.45rem;
}

.tag-input-shell input {
  width: 100%;
}

.tag-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.42rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.tag-suggestions.hidden {
  display: none;
}

.tag-suggestions-close {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0.06rem 0 0.35rem auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.tag-suggestions-close:hover,
.tag-suggestions-close:focus-visible {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.14);
  color: var(--primary);
}

.tag-suggestion {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0.52rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.tag-suggestion:hover,
.tag-suggestion.is-active {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.14);
  color: var(--primary);
}

.deep-research-dialog {
  width: min(780px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
}

.deep-research-controls {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.deep-research-controls input,
.deep-research-controls select {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  outline: none;
}

.deep-research-controls input:focus,
.deep-research-controls select:focus {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.deep-research-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
}

.deep-research-summary {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
}

.deep-research-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.deep-research-engine-hint {
  color: var(--muted);
  font-size: 0.75rem;
  word-break: break-word;
}

.deep-research-results {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  overflow-y: auto;
  overflow-x: clip;
  padding-right: 0.2rem;
  max-height: min(52vh, 420px);
  max-width: 100%;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.deep-research-result {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.75);
  min-width: 0;
  max-width: 100%;
  overflow: clip;
}

.deep-research-result-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.deep-research-result-head > div {
  min-width: 0;
  flex: 1;
}

.deep-research-result-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  margin-top: 0.35rem;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
  flex-shrink: 0;
}

.deep-research-result h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.deep-research-result p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.deep-research-snippet {
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.deep-research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.deep-research-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  word-break: break-word;
}

.deep-research-tag.empty {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

.deep-research-result-actions {
  display: flex;
  justify-content: flex-end;
}

.deep-research-result-actions button {
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.06);
  color: var(--primary);
  padding: 0.45rem 0.7rem;
  font-weight: 700;
}

.deep-research-quick-note {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.8);
  min-width: 0;
  max-width: 100%;
  overflow: clip;
  overflow-wrap: anywhere;
}

.deep-research-quick-note-header {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.deep-research-field {
  display: grid;
  gap: 0.42rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 0;
  max-width: 100%;
}

.deep-research-field input,
.deep-research-field select,
.deep-research-field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  resize: vertical;
  min-height: 44px;
  font: inherit;
  box-sizing: border-box;
}

.deep-research-field input {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.deep-research-field textarea {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deep-research-field textarea {
  min-height: 110px;
}

.deep-research-field input:focus,
.deep-research-field select:focus,
.deep-research-field textarea:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.deep-research-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.deep-research-form-actions > * {
  min-width: 0;
  max-width: 100%;
}

.deep-research-form-actions button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pin-deep-research-quick-note {
  position: relative;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pin-deep-research-quick-note::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.35;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 30;
}

.pin-deep-research-quick-note::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.2rem);
  transform: translateX(-50%) translateY(6px);
  width: 0.6rem;
  height: 0.6rem;
  background: rgba(15, 23, 42, 0.92);
  rotate: 45deg;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 29;
}

.pin-deep-research-quick-note:hover::after,
.pin-deep-research-quick-note:focus-visible::after,
.pin-deep-research-quick-note:hover::before,
.pin-deep-research-quick-note:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.deep-research-draft-warning {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.46);
  z-index: 40;
}

.deep-research-draft-warning.hidden {
  display: none;
}

.deep-research-draft-warning-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 1.1rem 1rem 1rem;
}

.deep-research-draft-warning-panel h3 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.deep-research-draft-warning-panel p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.deep-research-draft-warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

.deep-research-empty-state {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  padding: 0.8rem 0.9rem;
}

.deep-research-empty-state > div {
  display: grid;
  gap: 0.35rem;
}

.deep-research-empty-state strong {
  font-size: 0.96rem;
}

.deep-research-empty-state p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 200px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.6);
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
  padding: 1rem;
}

.diary-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 180px;
}

.diary-empty-state-action {
  width: auto;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
}

.help-modal.hidden {
  display: none;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
}

.help-dialog {
  position: relative;
  width: min(680px, calc(100vw - 2rem));
  max-width: 100%;
  max-height: min(80vh, 760px);
  overflow: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
  padding: 1.2rem 1.2rem 1rem;
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}

.help-header h2 {
  margin: 0.15rem 0 0;
  font-family: 'Newsreader', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.help-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.help-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.help-dialog-wide {
  width: min(900px, calc(100vw - 2rem));
  max-width: 100%;
}

.user-settings-grid {
  display: grid;
  gap: 1rem;
  margin-top: 0.65rem;
}

.user-setting-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--ink);
}

.user-setting-field span {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.user-setting-field select {
  width: min(100%, 360px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--ink);
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-weight: 600;
}

.help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0 1rem;
  padding: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.84);
}

.help-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.help-tab:hover,
.help-tab:focus-visible {
  border-color: rgba(79, 70, 229, 0.22);
  color: var(--ink);
  outline: none;
}

.help-tab.is-active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(59, 130, 246, 0.08));
  border-color: rgba(79, 70, 229, 0.28);
  color: var(--ink);
}

.help-panel {
  display: none;
}

.help-panel.is-active {
  display: block;
}

.vault-layout,
.trunk-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .trunk-row-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .trunk-badges {
    display: flex;
    width: 100%;
    gap: 0.35rem;
  }

  .trunk-badge,
  .last-updated-badge,
  .total-time-badge {
    flex: 1 1 33.333%;
    min-width: 0;
    width: 33.333%;
    justify-content: center;
    text-align: center;
  }

  .trunk-diary-item {
    display: flex;
    width: 100%;
    max-width: 100%;
    align-items: center;
    gap: 0.5rem;
  }

  .trunk-diary-name {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .trunk-diary-stats {
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    width: auto;
    max-width: 100%;
  }

  .trunk-diary-stats span {
    white-space: nowrap;
  }

  .vault-layout,
  .trunk-layout {
    grid-template-columns: 1fr;
  }

  .trunk-list-panel {
    order: -1;
    min-width: 0;
    max-width: 100%;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
  }

  .vault-list-panel {
    order: -1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .mobile-create-trunk-button {
    position: sticky;
    top: 0.5rem;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.7rem;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(14, 165, 233, 0.05));
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.12);
    z-index: 30;
    transition: width 0.24s ease, border-radius 0.24s ease, padding 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease, left 0.24s ease;
  }

  .mobile-create-trunk-button::before {
    content: "+";
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 800;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, width 0.18s ease;
  }

  .mobile-create-trunk-button.is-collapsed {
    width: 3rem;
    min-width: 3rem;
    max-width: 3rem;
    margin: 0 0 0.7rem;
    padding: 0.7rem 0;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2);
    justify-self: start;
  }

  .mobile-create-trunk-button.is-collapsed::before {
    content: "+";
    opacity: 1;
    width: 1.2rem;
    margin-right: 0;
  }

  .mobile-create-trunk-button.is-collapsed span {
    display: none;
  }

  .trunk-help-tooltip {
    flex-shrink: 0;
  }

  .trunk-help-tooltip::after {
    left: auto;
    right: 0;
    transform: translateY(6px);
    width: min(220px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }

  .trunk-help-tooltip::before {
    left: auto;
    right: 0.7rem;
    transform: translateY(6px);
  }

  .trunk-help-tooltip:hover::after,
  .trunk-help-tooltip:focus-visible::after,
  .trunk-help-tooltip:hover::before,
  .trunk-help-tooltip:focus-visible::before {
    transform: translateY(0);
  }

  .trunk-form-panel {
    position: static;
  }

  .vault-form input,
  .vault-form textarea,
  .trunk-form input,
  .trunk-form select,
  .api-key-form input,
  .api-key-form select,
  .trunk-toolbar input,
  .trunk-toolbar select,
  .diary-form input,
  .tag-form textarea,
  .tag-toolbar input,
  .deep-research-field input,
  .deep-research-field textarea,
  .clear-data-field input,
  .reminder-form textarea {
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
  }
}

.vault-form-panel,
.vault-list-panel,
.trunk-form-panel,
.trunk-list-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.7);
  border-radius: 18px;
  padding: 1rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

@media (min-width: 641px) {
  .mobile-create-trunk-button {
    display: none;
  }

  .trunk-form-panel {
    position: sticky;
    top: 1rem;
    align-self: start;
  }
}

.trunk-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.trunk-form-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.trunk-help-tooltip {
  position: relative;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(79, 70, 229, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(14, 165, 233, 0.08));
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.trunk-help-tooltip:hover,
.trunk-help-tooltip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.44);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.12);
  outline: none;
}

.trunk-help-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  visibility: hidden;
  white-space: normal;
  width: min(250px, 58vw);
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.45;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 40;
}

.trunk-help-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.18rem);
  transform: translateX(-50%) translateY(6px);
  width: 0.7rem;
  height: 0.7rem;
  background: rgba(15, 23, 42, 0.94);
  rotate: 45deg;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 39;
}

.trunk-help-tooltip:hover::after,
.trunk-help-tooltip:focus-visible::after,
.trunk-help-tooltip:hover::before,
.trunk-help-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.vault-form,
.trunk-form {
  display: grid;
  gap: 0.9rem;
}

.trunk-diary-search {
  width: 100%;
  min-height: 2.9rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.7rem 0.9rem;
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.trunk-diary-search:focus {
  outline: 3px solid rgba(79, 70, 229, 0.14);
  border-color: rgba(79, 70, 229, 0.34);
}

.trunk-diary-select {
  display: grid;
  gap: 0.9rem;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.trunk-diary-section {
  display: grid;
  gap: 0.5rem;
}

.trunk-diary-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(71, 85, 105, 0.9);
}

.trunk-diary-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding-right: 0.2rem;
}

@media (min-width: 641px) {
  .trunk-diary-select {
    max-height: min(52vh, 26rem);
    overflow: hidden;
  }

  .trunk-diary-list {
    max-height: 11rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
}

.trunk-diary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  max-width: 100%;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.trunk-diary-chip:hover,
.trunk-diary-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.38);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
  outline: none;
}

.trunk-diary-chip.is-selected {
  border-color: rgba(79, 70, 229, 0.36);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.08));
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.08);
}

.trunk-diary-pill-color {
  flex-shrink: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.trunk-diary-pill-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trunk-diary-pill-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.trunk-diary-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(71, 85, 105, 0.8);
  font-size: 0.82rem;
  text-align: center;
}

.vault-password-field {
  display: grid;
  gap: 0.45rem;
}

.vault-field-error {
  min-height: 1rem;
  color: var(--danger);
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.vault-field-error:not(:empty) {
  opacity: 1;
}

.vault-password-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.vault-password-input-row input {
  flex: 1;
}

.vault-form input.is-valid {
  border-color: rgba(15, 159, 110, 0.6);
  background: rgba(15, 159, 110, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 159, 110, 0.12);
}

.vault-form input.is-invalid {
  border-color: rgba(220, 38, 38, 0.6);
  background: rgba(220, 38, 38, 0.05);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.1);
}

#lockVaultButton {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#lockVaultButton:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-color: rgba(79, 70, 229, 0.3);
  color: #fff;
  box-shadow: 0 12px 22px rgba(79, 70, 229, 0.18);
}

#lockVaultButton:disabled {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
  color: rgba(71, 85, 105, 0.7);
  box-shadow: none;
  cursor: not-allowed;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(79, 70, 229, 0.36);
  background: rgba(238, 242, 255, 0.92);
  outline: none;
  transform: translateY(-1px);
}

.vault-directory {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.vault-directory-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.vault-directory-button {
  flex: 1;
}

.vault-directory-unlock,
.vault-directory-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.vault-directory-status {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #047857;
}

.vault-directory-button.is-active {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.16), rgba(255, 255, 255, 0.72));
  border-color: rgba(168, 85, 247, 0.28);
  color: #6d28d9;
}

.vault-read-only-panel {
  display: grid;
  gap: 0.85rem;
}

.vault-read-only-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.vault-read-only-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.vault-search-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.vault-search-field input,
.vault-record-field input,
.vault-record-field textarea,
#vaultReadOnlySearchInput,
#vaultRecordTitleInput,
#vaultRecordTextInput {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--ink);
  padding: 0.72rem 0.8rem;
  margin: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.vault-search-field input:focus,
.vault-record-field input:focus,
.vault-record-field textarea:focus,
#vaultReadOnlySearchInput:focus,
#vaultRecordTitleInput:focus,
#vaultRecordTextInput:focus {
  outline: 2px solid rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

.vault-record-editor {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.vault-record-editor-header h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.vault-record-form-row {
  display: block;
  gap: 0.75rem;
}

.vault-record-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.vault-record-field:last-child {
  margin-bottom: 0;
}

.vault-record-field-wide {
  width: 100%;
}

.vault-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vault-record-list,
.vault-read-only-list {
  display: grid;
  gap: 0.75rem;
  max-height: min(52vh, 26rem);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.vault-record-item,
.vault-readonly-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.vault-record-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin: -0.15rem 0 0.1rem;
  padding: 0;
}

.vault-readonly-item-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}

.vault-readonly-item-header .vault-readonly-meta {
  display: block;
  line-height: 1.2;
}

.vault-readonly-item-header .vault-readonly-meta strong {
  display: block;
  line-height: 1.2;
  font-size: 0.94rem;
}

.vault-readonly-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-left: 0;
}

.vault-readonly-actions button,
.vault-readonly-actions .muted-button,
.vault-readonly-actions .danger-button {
  padding: 0.32rem 0.6rem;
  font-size: 0.76rem;
  line-height: 1.2;
  min-height: auto;
}

.vault-record-preview,
.vault-readonly-secret {
  color: var(--ink-soft);
}

.vault-record-item-header strong,
.vault-readonly-meta strong {
  color: var(--ink);
}

.vault-secret-stack {
  display: grid;
  gap: 0.75rem;
}

.vault-form textarea,
.vault-form input,
.trunk-form label,
.api-key-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.vault-form input,
.vault-form textarea,
.trunk-form input,
.trunk-form select,
.api-key-form input,
.api-key-form select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.95);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.trunk-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
}

.task-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.task-rail-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.task-button {
  min-height: 2.4rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
}

.task-list {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.task-row {
  display: grid;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.7rem 0.8rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.task-row:hover,
.task-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.32);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.08);
  outline: none;
}

.task-row-title {
  font-weight: 700;
  color: var(--ink);
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
}

.task-row-numbers {
  justify-content: space-between;
  gap: 0.65rem;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.task-pill-active {
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

.task-pill-todo {
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
}

.task-pill-blocked {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.task-pill-done {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.task-pill-awaiting_feedback {
  background: rgba(251, 191, 36, 0.15);
  color: #92400e;
}

.task-pill-completed {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.task-pill-archived {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.task-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.task-linked-entry-wrap {
  display: grid;
  gap: 0.55rem;
}

.task-linked-entry-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.task-linked-entry-toggle.is-on,
.task-linked-entry-toggle.is-expanded {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.9);
}

.task-linked-entry-toggle.is-off {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.9);
}

.task-linked-entry-toggle-meta {
  min-width: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.14);
}

.task-linked-entry-arrow {
  font-size: 0.85rem;
  line-height: 1;
}

.task-linked-entry-content {
  display: grid;
  gap: 0.55rem;
}

.task-linked-entry-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.task-linked-entry-toolbar input {
  flex: 1;
  min-width: 0;
}

.task-linked-entry-content.is-collapsed {
  display: none;
}

.task-linked-entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 0.6rem;
}

.task-linked-entry-chip {
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(224, 231, 255, 0.8);
  color: #3730a3;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.task-linked-entry-results {
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.task-linked-entry-result {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.task-linked-entry-result.is-selected {
  border-color: rgba(99, 102, 241, 0.38);
  background: rgba(224, 231, 255, 0.8);
}

.task-linked-entry-result strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.task-linked-entry-result small {
  display: block;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.45;
}

.task-status-button,
.task-reminder-button,
.task-delete-button,
.tag-status-action {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.3rem 0.6rem;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.task-status-button:hover,
.task-reminder-button:hover,
.task-delete-button:hover,
.tag-status-action:hover,
.task-status-button:focus-visible,
.task-reminder-button:focus-visible,
.task-delete-button:focus-visible,
.tag-status-action:focus-visible {
  border-color: rgba(79, 70, 229, 0.26);
  background: rgba(79, 70, 229, 0.05);
  transform: translateY(-1px);
  outline: none;
}

.task-reminder-button {
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.24);
}

.task-delete-button {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.2);
}

.tag-status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.task-form {
  display: grid;
  gap: 1rem;
}

.task-grid {
  display: grid;
  gap: 0.9rem;
}

.task-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.task-form input,
.task-form select,
.task-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 0.72rem 0.8rem;
  font: inherit;
  font-weight: 600;
}

.task-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.task-summary-box {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04), rgba(14, 165, 233, 0.03));
  color: var(--ink-soft);
}

.task-summary-box strong {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-summary-box p {
  margin: 0;
  line-height: 1.5;
  color: var(--ink-soft);
}

.task-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.trunk-toolbar input,
.trunk-toolbar select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 640px) {
  .task-grid-two,
  .task-grid-three,
  .task-grid-four {
    grid-template-columns: 1fr;
  }
}

.trunk-toolbar input:focus,
.trunk-toolbar select:focus {
  border-color: rgba(79, 70, 229, 0.42);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
  outline: none;
}

.trunk-list {
  display: grid;
  gap: 0.8rem;
}

.trunk-row {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.trunk-activity-graph-wrap {
  display: grid;
  gap: 0.45rem;
}

.trunk-activity-graph {
  position: relative;
  width: 100%;
  height: 2.8rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.03), rgba(148, 163, 184, 0.02));
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.35rem 0.4rem 0.2rem;
}

.trunk-activity-day-labels {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1rem;
  pointer-events: none;
}

.trunk-activity-graph svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(100% - 0.7rem);
  display: block;
  margin-top: 0.45rem;
}

.trunk-activity-graph svg rect {
  cursor: help;
}

.trunk-activity-day-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: inline-block;
  min-width: 0.9rem;
  padding: 0.1rem 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: rgba(51, 65, 85, 0.82);
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.trunk-activity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0 0.15rem;
}

.trunk-activity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--muted);
}

.trunk-activity-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.trunk-activity-legend-item .trunk-activity-dot[style*="rgba(14, 165, 233, 0.8)"] {
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

.trunk-row.is-open {
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.trunk-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.trunk-row-head strong {
  display: block;
  font-size: 1rem;
}

.trunk-row-head p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.trunk-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.36rem;
}

.trunk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
}

.last-updated-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
}

.total-time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: #0f766e;
}

.trunk-badge.locked {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
}

.trunk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trunk-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.trunk-diary-list {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.35rem;
}

.trunk-diary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.08);
}

.trunk-diary-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}

.trunk-diary-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.55rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.trunk-diary-stats span {
  white-space: nowrap;
}

.trunk-latest-note-wrap {
  margin-top: 0.7rem;
}

.trunk-latest-note {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.04);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.trunk-latest-note:hover {
  border-color: rgba(79, 70, 229, 0.32);
  background: rgba(79, 70, 229, 0.06);
}

.trunk-latest-note-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.trunk-latest-note-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.trunk-latest-note-text {
  color: var(--ink-soft);
  line-height: 1.45;
  font-size: 0.82rem;
  white-space: normal;
  word-break: break-word;
}

.trunk-latest-note-date {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.trunk-diary-list span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--ink);
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.api-key-form {
  display: grid;
  gap: 0.85rem;
}

.api-key-actions {
  margin-top: 0.2rem;
}

.api-key-list {
  display: grid;
  gap: 0.75rem;
}

.api-key-row {
  display: grid;
  gap: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.9);
}

.api-key-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.api-key-row code {
  background: rgba(79, 70, 229, 0.08);
  border-radius: 8px;
  padding: 0.12rem 0.35rem;
  font-size: 0.75rem;
}

.api-key-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.help-steps {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.help-steps li + li {
  margin-top: 0.35rem;
}

.clear-data-dialog {
  width: min(560px, 100%);
}

.clear-data-content {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.clear-data-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.clear-data-field input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.9);
}

.backup-dialog {
  width: min(560px, 100%);
}

.backup-content {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.backup-warning-box {
  border: 1px solid rgba(220, 38, 38, 0.26);
  background: rgba(254, 242, 242, 0.8);
  color: #7f1d1d;
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.backup-warning-box strong {
  display: block;
  margin-bottom: 0.35rem;
}

.backup-warning-box p {
  margin: 0;
  line-height: 1.5;
}

.backup-summary {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink-soft);
  padding: 0.8rem 0.9rem;
  line-height: 1.5;
}

.backup-actions {
  margin-top: 0.8rem;
  justify-content: flex-end;
}

.help-content {
  display: grid;
  gap: 1rem;
}

.stanza-list {
  display: grid;
  gap: 0.8rem;
  margin: 0.5rem 0 1rem;
}

.stanza-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(248, 250, 252, 0.9);
}

.stanza-copy {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.stanza-key {
  font-weight: 800;
  color: var(--primary);
  word-break: break-word;
}

.stanza-copy p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.stanza-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stanza-edit,
.stanza-delete {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.stanza-edit {
  color: var(--primary);
}

.stanza-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.stanza-field-grid {
  display: grid;
  gap: 0.9rem;
}

.stanza-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 600;
}

.stanza-form input,
.stanza-form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.stanza-form input:focus,
.stanza-form textarea:focus {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.reminder-tab-bar {
  display: inline-flex;
  width: 100%;
  padding: 0.3rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  margin-bottom: 0.8rem;
}

.reminder-tab {
  flex: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
}

.reminder-tab.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.reminder-tab-panel.hidden,
.reminder-list.hidden,
.reminder-calendar-container.hidden {
  display: none;
}

.reminder-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.65rem 0 0.8rem;
}

.reminder-status-filter {
  display: grid;
  gap: 0.35rem;
  min-width: 10.5rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  flex: 1 1 10rem;
}

.reminder-status-filter select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 0.5rem 0.7rem;
  font: inherit;
}

.reminder-list {
  display: grid;
  gap: 0.8rem;
  margin: 0.5rem 0 1rem;
}

.reminder-calendar-container {
  display: grid;
  gap: 0.8rem;
  margin: 0.5rem 0 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 18px;
  background: rgba(255, 251, 235, 0.8);
}

.reminder-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.reminder-calendar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.reminder-calendar-nav,
.reminder-calendar-today {
  min-width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.reminder-calendar-today {
  min-width: auto;
  padding: 0.45rem 0.7rem;
  font-size: 0.74rem;
}

.reminder-calendar-header-meta {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 0;
  text-align: center;
}

.reminder-calendar-month {
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.reminder-calendar-filter-label {
  font-size: 0.68rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.reminder-calendar-weekdays,
.reminder-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.reminder-calendar-weekdays {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding-top: 0.2rem;
}

.reminder-calendar-weekdays span,
.reminder-calendar-day {
  text-align: center;
  min-height: 3.1rem;
}

.reminder-calendar-day {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.4rem 0.2rem 0.35rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.reminder-calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.reminder-calendar-day.is-muted {
  opacity: 0.45;
}

.reminder-calendar-day.is-selected {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(219, 234, 254, 0.85);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.reminder-calendar-day.is-complete {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(220, 252, 231, 0.9);
}

.reminder-calendar-day.is-today {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}

.reminder-calendar-day-number {
  font-size: 0.82rem;
  font-weight: 700;
}

.reminder-calendar-day-reminders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.12rem;
  width: 100%;
  min-height: 0.7rem;
}

.reminder-calendar-day-count {
  position: absolute;
  right: 0.25rem;
  bottom: 0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.26rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.reminder-calendar-day-summary {
  display: grid;
  gap: 0.6rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.reminder-calendar-day-summary-header {
  font-size: 0.8rem;
  color: var(--ink);
  font-weight: 800;
}

.reminder-calendar-day-summary-list {
  display: grid;
  gap: 0.5rem;
}

.reminder-calendar-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.reminder-calendar-item {
  flex: 1;
  display: grid;
  gap: 0.12rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  background: rgba(255, 251, 235, 0.8);
  padding: 0.55rem 0.7rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.reminder-calendar-item.is-complete {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(220, 252, 231, 0.9);
}

.reminder-calendar-item.is-upcoming {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(255, 251, 235, 0.8);
}

.reminder-calendar-item span {
  font-weight: 700;
}

.reminder-calendar-item small {
  color: var(--muted);
  font-size: 0.68rem;
}

.reminder-calendar-item-alert {
  color: #b45309;
  font-weight: 700;
}

.reminder-calendar-item-alert.is-complete {
  color: #166534;
}

.reminder-calendar-delete {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.reminder-calendar-empty {
  color: var(--muted);
  font-size: 0.8rem;
}

.reminder-calendar-pill {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.9);
}

.reminder-calendar-pill.is-upcoming {
  background: rgba(245, 158, 11, 0.9);
}

.reminder-calendar-pill.is-recurring {
  background: rgba(139, 92, 246, 0.95);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.reminder-calendar-pill.is-complete {
  background: rgba(34, 197, 94, 0.95);
}

.reminder-calendar-pill.is-all-day {
  background: rgba(99, 102, 241, 0.9);
}

.reminder-calendar-day-label {
  display: inline-block;
  font-size: 0.62rem;
  color: var(--muted);
}

.reminder-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 251, 235, 0.8);
}

.reminder-row.is-recurring {
  border-color: rgba(139, 92, 246, 0.28);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(255, 255, 255, 0.9));
}

.reminder-row.is-complete {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(220, 252, 231, 0.8);
}

.reminder-row.is-recurring.is-complete {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.11), rgba(220, 252, 231, 0.86));
}

.reminder-row.is-dismissed {
  border-color: rgba(148, 163, 184, 0.32);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(248, 250, 252, 0.9));
  opacity: 0.94;
}

.reminder-row.is-snoozed {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.22), rgba(239, 246, 255, 0.92));
}

.reminder-row.is-dismissed .reminder-copy strong,
.reminder-row.is-dismissed .reminder-copy span,
.reminder-row.is-dismissed .reminder-date-meta,
.reminder-row.is-dismissed .reminder-dismissed-summary,
.reminder-row.is-dismissed .reminder-description,
.reminder-row.is-snoozed .reminder-copy strong,
.reminder-row.is-snoozed .reminder-copy span,
.reminder-row.is-snoozed .reminder-date-meta,
.reminder-row.is-snoozed .reminder-snoozed-summary,
.reminder-row.is-snoozed .reminder-description {
  color: #475569;
}

.reminder-row.is-dismissed .reminder-recurring-badge,
.reminder-row.is-snoozed .reminder-recurring-badge {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.reminder-row.is-dismissed .reminder-next-up-label,
.reminder-row.is-snoozed .reminder-next-up-label {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.reminder-row.is-dismissed .reminder-actions button,
.reminder-row.is-snoozed .reminder-actions button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.reminder-snoozed-summary {
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.5;
}

.reminder-copy {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.reminder-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.reminder-copy strong {
  color: var(--ink);
  line-height: 1.4;
}

.reminder-recurring-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #6d28d9;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}

.reminder-copy span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.reminder-date-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.reminder-next-up-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #6d28d9;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.42rem;
  line-height: 1.3;
}

.reminder-description {
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.reminder-dismissed-summary {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.5;
}

.reminder-snoozed-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.reminder-snoozed-summary {
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.5;
}

.reminder-snooze-inline {
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.35);
  color: #1d4ed8;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  line-height: 1.3;
  cursor: pointer;
}

.reminder-completion-summary {
  color: #166534;
  font-weight: 700;
  font-size: 0.74rem;
  line-height: 1.5;
}

.reminder-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.reminder-edit,
.reminder-delete,
.reminder-skip,
.reminder-reactivate,
.reminder-link-notes,
.reminder-open-task,
.reminder-done {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.reminder-edit {
  color: #b45309;
}

.reminder-open-task {
  color: #7c2d12;
  background: rgba(255, 237, 213, 0.9);
  border-color: rgba(251, 146, 60, 0.28);
}

.reminder-done {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(220, 252, 231, 0.9);
}

.reminder-link-notes {
  color: #4338ca;
  background: rgba(224, 231, 255, 0.9);
  border-color: rgba(99, 102, 241, 0.25);
}

.reminder-link-notes.has-links {
  color: #166534;
  background: rgba(220, 252, 231, 0.9);
  border-color: rgba(22, 163, 74, 0.32);
  font-weight: 700;
}

.reminder-reactivate {
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.9);
  border-color: rgba(96, 165, 250, 0.3);
}

.reminder-skip {
  color: #7c2d12;
  background: rgba(255, 237, 213, 0.8);
  border-color: rgba(251, 146, 60, 0.35);
}

.reminder-skip-toast {
  margin-top: 0.15rem;
  justify-self: flex-start;
}

.reminder-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.reminder-end-date-row {
  margin-top: -0.05rem;
}

.reminder-field-grid {
  display: grid;
  gap: 0.9rem;
}

.reminder-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 600;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
}

.toggle-row input {
  width: auto;
  accent-color: #f59e0b;
}

.reminder-exclude-days {
  display: grid;
  gap: 0.5rem;
}

.reminder-exclude-label {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.reminder-day-toggle-group {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.reminder-day-toggle {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.reminder-day-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.4);
}

.reminder-day-toggle.is-selected {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(153, 27, 27, 0.12));
  border-color: rgba(245, 158, 11, 0.6);
  color: #7c2d12;
}

.reminder-linked-entry-wrap {
  display: grid;
  gap: 0.55rem;
}

.reminder-linked-entry-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.reminder-linked-entry-toggle:hover,
.reminder-linked-entry-toggle:focus-visible {
  border-color: rgba(99, 102, 241, 0.38);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.reminder-linked-entry-toggle.is-on,
.reminder-linked-entry-toggle.is-expanded {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.9);
}

.reminder-linked-entry-toggle.is-off {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.9);
}

.reminder-linked-entry-toggle-meta {
  min-width: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.14);
}

.reminder-linked-entry-toggle-meta.is-on {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.reminder-linked-entry-toggle-meta.is-off {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.reminder-linked-entry-arrow {
  font-size: 0.85rem;
  line-height: 1;
}

.reminder-linked-entry-content {
  display: grid;
  gap: 0.55rem;
}

.reminder-linked-entry-content.is-collapsed {
  display: none;
}

.reminder-linked-entry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 0.6rem;
}

.reminder-linked-entry-chip {
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(224, 231, 255, 0.8);
  color: #3730a3;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.reminder-toast-linked-fold {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.reminder-toast-linked-toggle {
  justify-self: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.reminder-toast-linked-toggle.is-on {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.reminder-toast-linked-toggle.is-off {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
}

.reminder-toast-linked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reminder-toast-linked-list.hidden {
  display: none;
}

.reminder-toast-linked-list .reminder-linked-entry-chip {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-linked-entry-results,
.reminder-note-search-list {
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.reminder-note-result,
.reminder-note-search-item {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.reminder-note-result.is-selected,
.reminder-note-search-item.is-selected {
  border-color: rgba(99, 102, 241, 0.38);
  background: rgba(224, 231, 255, 0.8);
}

.reminder-note-result strong,
.reminder-note-search-item strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.reminder-note-result small,
.reminder-note-search-item small {
  display: block;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.45;
}

.reminder-note-search-toolbar {
  margin-bottom: 0.75rem;
}

#reminderNoteSearchModalInput {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

#reminderNoteSearchModalInput:focus {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.reminder-form input,
.reminder-form select,
.reminder-form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.reminder-form textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.reminder-form input:focus,
.reminder-form select:focus,
.reminder-form textarea:focus {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.reminder-toast-container {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: min(360px, calc(100vw - 2rem));
}

.reminder-toast {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.12);
}

.reminder-toast[data-overdue='true'] {
  border-color: rgba(96, 165, 250, 0.38);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 20px 35px rgba(59, 130, 246, 0.1);
}

.reminder-toast.is-recurring {
  border-color: rgba(139, 92, 246, 0.42);
  background: linear-gradient(180deg, rgba(245, 243, 255, 0.98), rgba(255, 255, 255, 0.99));
  box-shadow: 0 20px 35px rgba(139, 92, 246, 0.11);
}

.reminder-toast[data-overdue='true'].is-recurring {
  border-color: rgba(139, 92, 246, 0.46);
  background: linear-gradient(180deg, rgba(237, 233, 254, 0.98), rgba(255, 255, 255, 0.99));
}

.reminder-toast-summary {
  border-style: dashed;
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(239, 246, 255, 0.96);
}

.reminder-toast strong {
  color: var(--ink);
  line-height: 1.3;
}

.reminder-toast p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: 0.82rem;
}

.reminder-toast-description {
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.reminder-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.reminder-countdown {
  color: #b45309;
  font-weight: 700;
}

.reminder-countdown-overdue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reminder-toast.is-recurring .reminder-countdown {
  color: #6d28d9;
}

.reminder-toast[data-overdue='true'] .reminder-countdown {
  color: #1d4ed8;
  font-weight: 800;
}

.reminder-toast[data-overdue='true'].is-recurring .reminder-countdown {
  color: #5b21b6;
}

.reminder-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.reminder-snooze-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.reminder-snooze-select {
  min-width: 5.5rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.38rem 0.5rem;
  font: inherit;
}

.reminder-snooze,
.reminder-done {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.42rem 0.7rem;
  cursor: pointer;
}

.reminder-done {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(220, 252, 231, 0.9);
}

.reminder-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.26rem 0.5rem;
}

.reminder-pill.is-recurring {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
}

.reminder-past-due-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.26);
  color: #2563eb;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.16rem 0.42rem;
  line-height: 1.2;
}

.reminder-trigger-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.reminder-dismiss {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  line-height: 1;
  font-size: 1rem;
}

.help-section {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 1rem;
}

.help-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.help-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.help-section p,
.help-section li {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 0.96rem;
}

.help-section ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

.help-section li + li {
  margin-top: 0.34rem;
}

.help-markdown-example {
  margin-top: 0.75rem;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.8rem 0.9rem;
}

.help-markdown-example strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.help-markdown-example pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .form-panel,
  .entries-panel {
    grid-column: auto;
  }

  .content-grid-resizer {
    display: none;
  }

  .form-panel {
    position: static;
  }

  .entry-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0.75rem;
    gap: 0.8rem;
  }

  .section-header,
  .topbar,
  .toolbar-inline,
  .form-actions,
  .entry-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-section .section-header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .sidebar-section .sidebar-header-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .sidebar-section .diary-header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-shrink: 0;
    flex-direction: column;
  }

  .diary-header-controls,
  .diary-header-controls > .chip-button,
  .sidebar-section .diary-header-actions > * {
    width: 100%;
  }

  .entry-card-main {
    order: 2;
  }

  .entry-actions {
    order: 1;
  }

  .stats-grid,
  .field-row-2,
  .field-row-3 {
    grid-template-columns: 1fr;
  }

  .diary-header-actions,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .diary-list {
    min-height: 150px;
    height: auto;
  }

  .ghost-button,
  .primary-button,
  .muted-button,
  .danger-button,
  .diary-form button,
  .chip-button {
    width: 100%;
  }

  .diary-row {
    align-items: flex-start;
    padding: 0.8rem 0.7rem;
  }
}
