:root {
  color-scheme: light;
  --maroon: #4d0d17;
  --maroon-2: #741923;
  --peach: #f2a36f;
  --peach-soft: #fff1e8;
  --mint: #6b8763;
  --ink: #1f2928;
  --muted: #697473;
  --line: #e4ddd7;
  --paper: #fffaf6;
  --surface: #ffffff;
  --danger: #a33b34;
  --focus: #2d7c9f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 163, 111, 0.20), transparent 32rem),
    linear-gradient(180deg, #fffaf6 0%, #f7f0ea 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

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

button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

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

.primary {
  color: #ffffff;
  background: var(--maroon);
}

.primary:hover {
  background: var(--maroon-2);
}

.secondary {
  color: var(--maroon);
  background: var(--peach-soft);
  border: 1px solid rgba(116, 25, 35, 0.18);
}

.ghost {
  color: var(--maroon);
  background: transparent;
  border: 1px solid var(--line);
}

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

.full {
  width: 100%;
}

.eyebrow {
  color: var(--maroon-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 24px;
  padding: 32px;
  border: 1px solid rgba(77, 13, 23, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(77, 13, 23, 0.14);
}

.brand-lockup {
  display: block;
}

.brand-lockup img {
  display: block;
  width: min(260px, 100%);
  height: auto;
}

.login-form,
.form-panel {
  display: grid;
  gap: 14px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 246, 0.96);
}

.sidebar-head,
.workbench-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sidebar h1,
.workbench-top h2 {
  font-size: 24px;
}

.search-wrap input {
  min-height: 38px;
}

.saved-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
}

.saved-item {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
}

.saved-item:hover,
.saved-item.active {
  border-color: rgba(116, 25, 35, 0.45);
  background: var(--peach-soft);
}

.saved-title {
  font-size: 14px;
  font-weight: 900;
}

.saved-meta {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

.workbench {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
}

.workbench-top {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 32px rgba(77, 13, 23, 0.08);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

section h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--maroon);
  font-size: 17px;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  font-size: 14px;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
}

legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

fieldset input {
  width: 16px;
  min-height: 16px;
}

@media (max-width: 1020px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .saved-list {
    max-height: 260px;
  }

  .workbench-top {
    position: relative;
  }
}

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

  .workbench,
  .sidebar {
    padding: 14px;
  }

  .workbench-top,
  .sidebar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 auto;
  }
}
