:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #fffefb;
  --surface-soft: #f1efea;
  --ink: #171715;
  --muted: #6f6c64;
  --line: #dbd7ce;
  --line-strong: #bdb7aa;
  --field: #fbfaf7;
  --accent: #171715;
  --accent-soft: #e8e2d7;
  --sage: #65705d;
  --rose: #9c5250;
  --focus: #5a6f91;
  --shadow: 0 24px 70px rgb(24 22 18 / 8%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.screen {
  width: min(1080px, calc(100vw - 36px));
  margin: 0 auto;
}

.lock-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 0;
}

.lock-panel {
  display: grid;
  width: min(430px, 100%);
  gap: 26px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
}

.brand-mark h1,
.topbar h1,
.entry-date time {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

.brand-mark h1 {
  font-size: clamp(2.15rem, 10vw, 3.1rem);
}

.brand-mark p,
.empty-state,
.hint,
.meta,
.comment-time {
  color: var(--muted);
}

.brand-mark p {
  margin: 1px 0 0;
}

.unlock-form,
.entry-form,
.comment-form {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--field);
  color: var(--ink);
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(90 111 145 / 16%);
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 760;
}

.primary-button {
  gap: 9px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: #000;
}

.secondary-button {
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button {
  width: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  padding: 30px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: clamp(2.5rem, 7vw, 4.9rem);
  line-height: 0.95;
}

.topbar-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.timeline-menu {
  position: relative;
}

.timeline-button {
  min-height: 34px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
}

.timeline-button:hover,
.timeline-button[aria-expanded="true"] {
  text-decoration-color: var(--ink);
}

.timeline-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 10;
  display: grid;
  width: min(280px, calc(100vw - 36px));
  max-height: min(420px, 70vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timeline-dropdown button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 46px;
  padding: 9px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.timeline-dropdown button:hover,
.timeline-dropdown button.active {
  background: var(--surface-soft);
}

.timeline-dropdown small {
  color: var(--muted);
  font-size: 0.76rem;
}

.role-pill,
.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.status-pill {
  background: #e6eadf;
  color: var(--sage);
}

.status-pill.draft {
  background: #efe2df;
  color: var(--rose);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-top: 28px;
}

.owner-panel,
.entry-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.owner-panel {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.panel-title,
.comments-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.owner-panel header {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}

.owner-panel p {
  margin: 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.entries {
  display: grid;
  gap: 18px;
}

.entry-card {
  overflow: hidden;
}

.entry-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 10px;
}

.entry-date {
  display: grid;
  gap: 4px;
}

.entry-date time {
  font-size: clamp(1.42rem, 5vw, 2.1rem);
}

.entry-content {
  white-space: pre-wrap;
  padding: 6px 20px 22px;
  line-height: 1.72;
}

.comments {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 17px 20px 20px;
  background: var(--surface-soft);
}

.comments-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-list {
  display: grid;
  gap: 12px;
}

.comment {
  display: grid;
  gap: 4px;
  border-left: 2px solid var(--line-strong);
  padding-left: 11px;
}

.comment strong {
  font-size: 0.92rem;
}

.comment p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.comment-time,
.meta {
  font-size: 0.82rem;
}

.comment-form {
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto;
  align-items: end;
}

.comment-form textarea {
  min-height: 72px;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert {
  min-height: 22px;
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 38px;
  background: var(--surface);
  text-align: center;
}

.hidden {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .owner-panel {
    position: static;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .screen {
    width: min(100% - 22px, 1080px);
  }

  .lock-panel {
    padding: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .timeline-menu {
    margin-right: auto;
  }

  .timeline-dropdown {
    right: auto;
    left: 0;
  }

  .entry-card header {
    flex-direction: column;
  }
}
