:root {
  color-scheme: dark;
  --bg: #14110e;
  --ink: #f4efe6;
  --muted: #b3a89a;
  --card: #221c17;
  --line: #3a3128;
  --copper: #e08a4f;
  --copper-ink: #2a1408;
  --danger: #e07a62;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100dvh;
}

.lock {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  padding: 8vh 7vw 10vh;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(224, 138, 79, 0.18), transparent 42%),
    linear-gradient(180deg, #1c1713 0%, var(--bg) 55%);
}

.mark {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.5rem, 14vw, 8rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.lock h1 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
}

#unlock,
.editor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 28rem;
}

label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #100e0c;
  border-radius: 0.4rem;
  padding: 0.75rem 0.85rem;
}

textarea {
  min-height: 14rem;
  resize: vertical;
}

button.primary,
.lock button {
  border: 0;
  border-radius: 999px;
  background: var(--copper);
  color: var(--copper-ink);
  padding: 0.75rem 1.2rem;
  font-weight: 650;
}

button.ghost,
button.text {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
}

button.text {
  border: 0;
  padding: 0.2rem 0;
  color: var(--muted);
}

.status, .quiet {
  color: var(--muted);
  margin: 0;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 6vw 0.4rem;
}

.top .mark {
  font-size: 2.4rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem 6vw 0.8rem;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
}

.panel {
  padding: 1.2rem 6vw 3rem;
  display: grid;
  gap: 1rem;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.row input[type="text"] { flex: 1; }

.list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list button.item,
.card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 0.7rem;
  padding: 0.8rem 0.9rem;
}

.list button.item[aria-current="true"] {
  border-color: var(--copper);
}

.todo {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 0.7rem;
  padding: 0.7rem 0.9rem;
}

.todo label {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 1rem;
}

.todo.done span { text-decoration: line-through; color: var(--muted); }

.file {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 0.7rem;
  padding: 0.8rem 0.9rem;
}

.file .actions, .editor-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

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

label.upload {
  display: inline-block;
  width: fit-content;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--copper-ink);
  background: var(--copper);
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-weight: 650;
}

.banner {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.8rem 0.9rem;
  color: var(--muted);
}

.editor {
  display: grid;
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .file, .todo { align-items: flex-start; flex-direction: column; }
  .lock { justify-content: center; }
}
