:root {
  --black-1: #14100a;
  --black-2: #050403;
  --panel: #18130d;
  --panel-2: #211a10;
  --gold: #d9a93b;
  --gold-light: #f3d98b;
  --gold-deep: #9c6e15;
  --cream: #f3eedf;
  --muted: #a89877;
  --border-gold: rgba(217, 169, 59, 0.22);
  --error: #e2574c;
  --overdue: #e2574c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--black-1) 0%, var(--black-2) 340px, var(--black-2) 100%);
  min-height: 100vh;
  color: var(--cream);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 12px;
  color: var(--cream);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.app-header h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-gold);
  flex-shrink: 0;
}

.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.capture-form {
  display: flex;
  gap: 8px;
}

.capture-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  background: var(--panel-2);
  color: var(--cream);
  font-size: 15px;
}

.capture-form input::placeholder {
  color: var(--muted);
}

.capture-form button {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: #171208;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.voice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: #171208;
  font-weight: 600;
}

.mic-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 8px 20px rgba(156, 110, 21, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.mic-btn:active {
  transform: scale(0.94);
}

.mic-btn.recording {
  background: linear-gradient(135deg, #e2574c, #c0392b);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 87, 76, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(226, 87, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 87, 76, 0); }
}

.mic-icon {
  width: 16px;
  height: 22px;
  border: 2px solid #171208;
  border-radius: 9px;
  position: relative;
  display: block;
}

.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 22px;
  height: 10px;
  border: 2px solid #171208;
  border-top: none;
  border-radius: 0 0 12px 12px;
}

.reminder-btn {
  align-self: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: var(--panel);
  color: var(--gold-light);
  font-size: 13px;
  cursor: pointer;
}

.reminder-btn[hidden] { display: none; }

.reminder-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.reminder-hint[hidden] { display: none; }

.status {
  font-size: 13px;
  color: var(--muted);
  min-height: 16px;
  margin: 0;
}

.error-msg {
  background: rgba(226, 87, 76, 0.12);
  border: 1px solid rgba(226, 87, 76, 0.3);
  color: #ff8a80;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 0;
}

.error-msg[hidden] { display: none; }

.card {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.card-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-badge {
  font-size: 11px;
  background: rgba(217, 169, 59, 0.14);
  color: var(--gold-light);
  padding: 3px 10px;
  border-radius: 999px;
}

.mock-badge[hidden] { display: none; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: var(--panel-2);
  font-size: 15px;
  color: var(--cream);
  font-family: inherit;
  color-scheme: dark;
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: #171208;
  font-weight: 600;
}

.btn-secondary {
  background: var(--panel-2);
  border: 1px solid var(--border-gold);
  color: var(--cream);
}

.btn-danger {
  background: var(--error);
  color: #fff;
  font-weight: 600;
}

.confirm-delete-text {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-title {
  font-size: 14px;
  color: var(--gold-light);
  margin: 4px 0 0;
  font-weight: 600;
}

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.action-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--gold);
}

.action-item-body {
  flex: 1;
  min-width: 0;
}

.action-item-text {
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
  color: var(--cream);
}

.action-item-due {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.action-item-due.overdue {
  color: var(--overdue);
  font-weight: 600;
}

.action-item-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.action-item-buttons button {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
}

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

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 8px 0;
}

.empty-hint[hidden] { display: none; }

.done-toggle {
  background: var(--panel);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.done-section.expanded .chevron {
  transform: rotate(180deg);
}

.done-list[hidden] { display: none; }
