:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-soft: #f0eee8;
  --ink: #22201b;
  --muted: #716b61;
  --line: #ddd8ce;
  --accent: #c9452b;
  --accent-strong: #a93622;
  --green: #3a7d56;
  --blue: #386d9d;
  --shadow: 0 18px 45px rgba(34, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(246, 245, 241, 0.86), rgba(246, 245, 241, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='620' viewBox='0 0 900 620'%3E%3Crect width='900' height='620' fill='%23e7e2d7'/%3E%3Cg fill='none' stroke='%23b9ae9d' stroke-width='3' opacity='.55'%3E%3Cpath d='M120 130h520M120 220h660M120 310h450M120 400h590'/%3E%3Ccircle cx='70' cy='130' r='18'/%3E%3Ccircle cx='70' cy='220' r='18'/%3E%3Ccircle cx='70' cy='310' r='18'/%3E%3Ccircle cx='70' cy='400' r='18'/%3E%3C/g%3E%3Cg fill='%23c9452b' opacity='.55'%3E%3Crect x='650' y='110' width='140' height='36' rx='6'/%3E%3Crect x='575' y='380' width='190' height='36' rx='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.unlock-panel {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.unlock-panel h1,
.main-header h1,
.sidebar h2 {
  margin: 10px 0 8px;
}

.unlock-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.unlock-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 69, 43, 0.14);
}

button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  font-weight: 750;
}

button:hover,
.secondary-button:hover {
  background: var(--accent-strong);
}

.hint {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.error {
  min-height: 20px;
  color: var(--accent-strong) !important;
  font-weight: 700;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #ede9df;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-top,
.main-header,
.panel-heading,
.section-title,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.icon-button:hover {
  background: var(--surface-soft);
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

.nav-list,
.project-list,
.task-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.project-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
}

.nav-item:hover,
.project-item:hover,
.nav-item.is-active,
.project-item.is-active {
  background: var(--surface);
}

.nav-item strong {
  color: var(--muted);
}

.project-panel h3,
.section-title h2,
.composer h2,
.detail-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.storage-panel {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.secondary-button {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
}

#import-file {
  display: none;
}

.main {
  min-width: 0;
  padding: 28px;
}

.main-header {
  align-items: end;
  margin-bottom: 18px;
}

.search-wrap {
  width: min(320px, 100%);
}

.composer,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(34, 32, 27, 0.06);
}

.composer {
  padding: 16px;
  margin-bottom: 20px;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 150px 92px auto;
  gap: 10px;
  margin-top: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.task-column {
  min-width: 0;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--accent);
}

.text-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.task-card:hover,
.task-card.is-selected {
  border-color: rgba(201, 69, 43, 0.55);
}

.complete-toggle {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  padding: 0;
}

.complete-toggle:hover,
.task-card.is-completed .complete-toggle {
  background: var(--green);
  border-color: var(--green);
}

.task-card.is-completed h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.task-body {
  min-width: 0;
}

.task-body h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.task-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pill.priority-1 {
  background: rgba(201, 69, 43, 0.14);
  color: var(--accent-strong);
}

.pill.priority-2 {
  background: rgba(56, 109, 157, 0.14);
  color: var(--blue);
}

.detail-panel {
  position: sticky;
  top: 20px;
  padding: 16px;
}

.detail-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.danger-button {
  background: #5f2921;
}

.danger-button:hover {
  background: #471e18;
}

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

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

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

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

  .main-header {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .main,
  .sidebar,
  .unlock-panel {
    padding: 18px;
  }

  .detail-row,
  .storage-panel {
    grid-template-columns: 1fr;
  }

  .sidebar-top,
  .section-title {
    align-items: flex-start;
  }
}
