:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --ink: #1b2226;
  --muted: #5c6b73;
  --line: #d9e0e3;
  --accent: #176b75;
  --accent-ink: #ffffff;
  --danger: #8a2f2f;
  --new: #a8590b;
  --radius: 10px;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 1rem;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

button.secondary {
  background: var(--surface);
}

button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

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

.auth-card {
  max-width: 26rem;
  margin: 12vh auto 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.brand {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.feedback {
  min-height: 1.5rem;
  color: var(--muted);
  margin-top: 1rem;
}

.feedback.error {
  color: var(--danger);
}

.paste-box {
  margin-top: 1.5rem;
  text-align: left;
  color: var(--muted);
}

.paste-box input {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
}

.brand-row {
  padding: 0 0.5rem 0.75rem;
}

.session-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.session-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 0.6rem 0.75rem;
}

.session-row[aria-current="true"] {
  border-color: var(--accent);
  background: #eef5f6;
}

.session-row .title {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row .meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.82rem;
}

.session-row .last-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.badge {
  display: inline-block;
  background: var(--new);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0 0.5rem;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem 0;
  border-top: 1px solid var(--line);
}

.notification-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 1.25rem;
}

.main-pane {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 3rem;
  min-width: 0;
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.session-header h1 {
  font-size: 1.35rem;
  margin: 0;
}

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

.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.item-card header {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.item-card h2 {
  font-size: 1.05rem;
  margin: 0;
  flex: 1 1 auto;
}

.item-card .kind {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.item-card time {
  color: var(--muted);
  font-size: 0.82rem;
}

.item-card .body {
  margin-top: 0.75rem;
}

.preview-host {
  width: 100%;
  min-height: 8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.preview-host iframe {
  display: block;
  width: 100%;
  height: 22rem;
  border: 0;
}

.preview-host pre {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.removed-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state,
.loading-state {
  color: var(--muted);
  padding: 2rem 0;
}

.drawer-toggle {
  display: none;
}

@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
  }

  .drawer-toggle {
    display: block;
    margin: 0.75rem;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.15s ease;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.18);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-pane {
    padding: 0 1rem 3rem;
  }

  .preview-host iframe {
    height: 16rem;
  }
}
