:root {
  --bg: #121212;
  --surface: #1c1c1e;
  --ink: #f2f0eb;
  --muted: #8a8a8e;
  --accent: #e8734a;
  --ok: #5fae8f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

header {
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#offline-banner {
  background: rgba(232, 115, 74, 0.15);
  color: var(--accent);
  padding: 10px 20px;
  font-size: 0.85rem;
}

#feed {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 120px;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 3px solid transparent;
}

.card--reponse { border-left-color: var(--accent); }

.card__meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card__content {
  margin-top: 4px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.card__time {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
}

.feed-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 0.9rem;
}

#record-btn {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-size: 1.8rem;
  cursor: pointer;
}

#record-btn.recording {
  background: #d15a33;
}

#settings-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 11;
}

#settings-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 11;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.segmented {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.segmented button {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.segmented button.active {
  background: var(--accent);
  color: var(--bg);
}

#view-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px 12px;
}

.view-tab {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.view-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

#tasks-list {
  padding: 12px 16px 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.task-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-card__checkbox {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.task-card__body {
  flex: 1;
}

.task-card__content {
  font-size: 0.95rem;
  line-height: 1.4;
}

.task-card__due {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.task-card__due.overdue {
  color: var(--accent);
}

#task-form {
  position: fixed;
  bottom: 110px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

#task-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  min-width: 0;
}

#task-form button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

#calendar-view {
  display: flex;
  flex-direction: column;
  padding: 0 16px 220px;
  overflow-y: auto;
}

#calendar {
  margin-bottom: 16px;
}

[data-vc-date].has-events [data-vc-date-btn] {
  position: relative;
}

[data-vc-date].has-events [data-vc-date-btn]::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

#day-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.event-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.event-card__body {
  flex: 1;
}

.event-card__content {
  font-size: 0.95rem;
  line-height: 1.4;
}

.event-card__time {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.event-card__delete {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

#event-form {
  position: fixed;
  bottom: 110px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

#event-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  min-width: 0;
}

#event-time-input {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.8rem;
  color-scheme: dark;
}

#event-form button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

#queue-badge {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(calc(-50% + 30px));
  background: var(--muted);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

@keyframes ripple-btn {
  0% { box-shadow: 0 0 0 0 rgba(232, 115, 74, 0.5); }
  100% { box-shadow: 0 0 0 24px rgba(232, 115, 74, 0); }
}

#record-btn.ripple {
  animation: ripple-btn 0.6s ease-out;
}

@keyframes ripple-in {
  0% { box-shadow: 0 0 0 0 rgba(232, 115, 74, 0.35); background: var(--surface); }
  30% { background: rgba(232, 115, 74, 0.12); }
  100% { box-shadow: 0 0 0 12px rgba(232, 115, 74, 0); background: var(--surface); }
}

.card.ripple-in {
  animation: ripple-in 0.8s ease-out;
}

#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  width: min(90%, 360px);
}

.toast {
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#token-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

#token-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 320px);
}

#token-input {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 1rem;
}

#token-form button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #record-btn.ripple,
  .card.ripple-in {
    animation: none;
  }
}
