:root {
  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Space Grotesk", "Trebuchet MS", sans-serif;
  --bg-off: #42b83f;
  --bg-on: #ff4b54;
  --bg-break: #f26d3c;
  --panel-white: rgba(255, 255, 255, 0.12);
  --panel-border: rgba(255, 255, 255, 0.28);
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.86);
  --text-faint: rgba(255, 255, 255, 0.7);
  --shadow: 0 32px 70px rgba(0, 0, 0, 0.16);
  --accent-ink: #24933d;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-main);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12)),
    var(--bg-off);
  transition: background 220ms ease;
}

body.status-off {
  --theme-bg: var(--bg-off);
  --accent-ink: #24933d;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12)),
    var(--bg-off);
}

body.status-on {
  --theme-bg: var(--bg-on);
  --accent-ink: #f1434d;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12)),
    var(--bg-on);
}

body.status-break {
  --theme-bg: var(--bg-break);
  --accent-ink: #db5b30;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12)),
    var(--bg-break);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

textarea {
  resize: vertical;
  min-height: 10rem;
}

label {
  display: block;
  color: var(--text-soft);
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-screen,
.dashboard-view {
  width: 100%;
  display: grid;
  place-items: center;
}

.auth-card,
.time-card {
  width: min(100%, 460px);
  border-radius: 34px;
  padding: 2rem 1.5rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 1.5rem;
}

.auth-hero,
.auth-panel,
.time-card,
.detail-panel,
.settings-section {
  display: grid;
  gap: 1rem;
}

.micro-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.auth-hero h1 {
  font-size: clamp(2.1rem, 8vw, 3rem);
  line-height: 0.95;
  max-width: 11ch;
}

.auth-copy,
.muted-text,
.status-subtext,
.entry-meta,
.entry-note,
.export-hint,
.tiny-note {
  color: var(--text-faint);
  line-height: 1.55;
}

.auth-tabs,
.primary-actions,
.secondary-actions,
.metric-row,
.settings-header,
.panel-heading-row,
.card-top {
  display: flex;
  gap: 0.85rem;
}

.auth-tabs {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem;
  border-radius: 999px;
}

.auth-tab,
.primary-btn,
.secondary-btn,
.ghost-btn,
.text-btn,
.icon-btn {
  border: 0;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.auth-tab {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-ink);
}

.auth-form {
  display: none;
  gap: 1rem;
}

.auth-form.active {
  display: grid;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 20px;
  padding: 0.95rem 1rem;
  font-weight: 800;
}

.primary-btn {
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-ink);
}

.secondary-btn {
  background: transparent;
  border: 3px solid rgba(255, 255, 255, 0.92);
  color: var(--text-main);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.text-btn {
  padding: 0;
  background: transparent;
  color: var(--text-main);
  font-weight: 700;
}

.icon-btn {
  width: 3rem;
  height: 3rem;
  padding: 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-ink);
}

.icon-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.card-top,
.settings-header,
.panel-heading-row {
  align-items: center;
  justify-content: space-between;
}

.status-pill {
  justify-self: center;
  padding: 0.5rem 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
}

.clock-hero {
  justify-items: center;
  text-align: center;
}

.main-clock {
  gap: 0.7rem;
}

.compact-clock {
  gap: 0.55rem;
}

.clock-illustration {
  position: relative;
  width: 15.5rem;
  aspect-ratio: 1;
}

.compact-clock .clock-illustration {
  width: 11rem;
}

.clock-illustration::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 0.8rem solid rgba(255, 255, 255, 0.96);
  border-bottom-color: transparent;
}

.tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.26rem;
  height: 1rem;
  margin-left: -0.13rem;
  margin-top: -6.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(var(--rotation));
  transform-origin: center 6.55rem;
}

.compact-clock .tick {
  height: 0.82rem;
  margin-top: -4.65rem;
  transform-origin: center 4.65rem;
}

.tick:nth-child(1),
.tick:nth-child(4),
.tick:nth-child(7),
.tick:nth-child(10) {
  height: 1.45rem;
}

.compact-clock .tick:nth-child(1),
.compact-clock .tick:nth-child(4),
.compact-clock .tick:nth-child(7),
.compact-clock .tick:nth-child(10) {
  height: 1.1rem;
}

.clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  transform-origin: center bottom;
  margin-left: -0.11rem;
}

.hour-hand {
  height: 4rem;
}

.minute-hand {
  height: 5.4rem;
}

.second-hand {
  height: 5.9rem;
  width: 0.12rem;
  margin-left: -0.06rem;
  opacity: 0.85;
}

.compact-clock .hour-hand {
  height: 2.8rem;
}

.compact-clock .minute-hand {
  height: 3.8rem;
}

.compact-clock .second-hand {
  height: 4.2rem;
}

.clock-readout {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

#statusHeadline {
  font-size: 1.9rem;
}

.metric-row {
  justify-content: center;
}

.metric-chip {
  min-width: 8.7rem;
  padding: 0.8rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.metric-chip span {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric-chip strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.action-stack {
  display: grid;
  gap: 0.85rem;
}

.primary-actions button,
.secondary-actions button {
  flex: 1;
}

.feedback {
  min-height: 1.3rem;
  color: #fff1bd;
}

.center-feedback {
  text-align: center;
}

.detail-panel {
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.panel-label,
.panel-title {
  color: var(--text-main);
}

.recent-list,
.selection-list,
.history-list,
.stacked-actions {
  display: grid;
  gap: 0.85rem;
}

.timeline-card,
.selection-card,
.history-card,
.empty-state {
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.entry-topline,
.entry-meta-row,
.history-header,
.status-tag-row,
.checkbox-row {
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: center;
}

.entry-topline,
.history-header {
  align-items: flex-start;
}

.entry-title,
.history-title {
  font-weight: 800;
  color: var(--text-main);
}

.entry-meta,
.entry-note,
.export-hint,
.tiny-note {
  font-size: 0.92rem;
}

.status-tag {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-success {
  background: rgba(255, 255, 255, 0.24);
}

.tag-danger {
  background: rgba(116, 0, 10, 0.25);
}

.tag-warning {
  background: rgba(146, 69, 0, 0.24);
}

.checkbox-row {
  justify-content: flex-start;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.empty-state {
  text-align: center;
  color: var(--text-faint);
}

.full-width {
  width: 100%;
}

.settings-scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(4px);
  z-index: 4;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(34rem, 100vw);
  height: 100vh;
  z-index: 5;
  overflow-y: auto;
  padding: 1.2rem;
  background: rgba(29, 29, 29, 0.88);
  color: #fff;
  box-shadow: -24px 0 50px rgba(0, 0, 0, 0.2);
}

.settings-drawer .muted-text,
.settings-drawer .entry-meta,
.settings-drawer .entry-note,
.settings-drawer .export-hint,
.settings-drawer .tiny-note {
  color: rgba(255, 255, 255, 0.72);
}

.settings-section {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0.75rem;
  }

  .auth-card,
  .time-card {
    width: 100%;
    min-height: calc(100vh - 1.5rem);
    border-radius: 28px;
    padding: 1.25rem 1rem 1rem;
  }

  .primary-actions,
  .secondary-actions,
  .metric-row,
  .card-top,
  .panel-heading-row,
  .settings-header {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-chip {
    min-width: 0;
  }

  .clock-illustration {
    width: min(14rem, 62vw);
  }

  .tick {
    margin-top: -5.9rem;
    transform-origin: center 5.9rem;
  }
}
