:root {
  --gold-600: #c9920e;
  --gold-700: #a8780b;
  --gold-100: #f9efc7;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8f7f4;
  --card: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
  background: #1a1a2e;
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-600);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text small {
  font-size: 12px;
  opacity: 0.7;
}

.header-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Hero / guidelines ---------- */
.hero {
  padding: 28px 0 8px;
}

.hero h1 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hero > p {
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 60ch;
}

.guidelines {
  background: var(--gold-100);
  border: 1px solid #eadcae;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.guidelines h2 {
  font-size: 15px;
  margin: 0 0 6px;
}

.guidelines p {
  font-size: 14px;
  margin: 0 0 8px;
  color: #6d5a10;
}

.guidelines ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: #6d5a10;
}

.guidelines li {
  margin-bottom: 3px;
}

/* ---------- Form ---------- */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.todo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.todo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.todo-num {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold-700);
}

.remove-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

.remove-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.input-select,
.input-textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-select:focus,
.input-textarea:focus {
  outline: none;
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(201, 146, 14, 0.18);
}

.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* Two-column select layout (desktop) */
.todo-card .field:not(.field-full) {
  grid-column: span 1;
}

@media (min-width: 560px) {
  .todo-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .todo-card-head,
  .field-full {
    grid-column: 1 / -1;
  }
}

/* ---------- File upload & previews ---------- */
.file-input {
  font-size: 14px;
  color: var(--muted);
}

.file-input::file-selector-button {
  font: inherit;
  background: var(--gold-100);
  color: var(--gold-700);
  border: 1px solid #eadcae;
  border-radius: 8px;
  padding: 8px 14px;
  margin-right: 10px;
  cursor: pointer;
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview {
  position: relative;
}

.preview img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:active {
  transform: scale(0.99);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--gold-700);
}

.btn-secondary {
  background: #1a1a2e;
  color: #fff;
}

.btn-secondary:hover {
  background: #2d2d4a;
}

.btn-ghost {
  background: transparent;
  color: var(--gold-700);
  border: 1px solid #d9c681;
}

.btn-ghost:hover {
  background: var(--gold-100);
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

@media (min-width: 480px) {
  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.form-status {
  text-align: center;
  font-size: 14px;
  min-height: 20px;
}

.form-status.is-error,
.muted.is-error {
  color: var(--danger);
}

/* ---------- Success panel ---------- */
.success-panel {
  background: var(--card);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  margin: 20px 0;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.success-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ---------- Review page ---------- */
.review-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0 4px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 560px) {
  .filters {
    flex-direction: row;
    gap: 12px;
  }
  .filters label {
    flex: 1;
  }
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.review-summary {
  padding-top: 12px;
}

.review-summary .muted {
  margin: 0;
}

.review-group {
  margin: 18px 0;
}

.review-group h2 {
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--gold-700);
}

.section-head {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 14px 0 8px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.todo-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item.is-done {
  opacity: 0.55;
}

.todo-item.is-done .todo-text {
  text-decoration: line-through;
}

.todo-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
}

.status-badge.open {
  background: var(--gold-100);
  color: var(--gold-700);
}

.status-badge.done {
  background: #dcfce7;
  color: #15803d;
}

.todo-date {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.todo-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumb {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.thumb img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  display: block;
}

.todo-actions {
  display: flex;
  gap: 8px;
}

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

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 0 40px;
  text-align: center;
}

.site-footer p {
  color: var(--muted);
  font-size: 13px;
}
