:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #161517;
  --surface-2: #242127;
  --line: rgba(255, 255, 255, 0.11);
  --text: #fffaf3;
  --muted: #b9b0a8;
  --subtle: #7f7670;
  --accent: #ff8a2a;
  --accent-hot: #ff4f38;
  --accent-2: #42d4bd;
  --danger: #ff5d5d;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.46);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 79, 56, 0.24), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(66, 212, 189, 0.16), transparent 24%),
    linear-gradient(135deg, #09090b 0%, #161216 48%, #24150f 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 48px));
  max-height: 920px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  background: rgba(12, 12, 14, 0.96);
  box-shadow: var(--shadow);
}

.home-shell {
  background:
    linear-gradient(180deg, rgba(255, 138, 42, 0.1), transparent 38%),
    rgba(12, 12, 14, 0.97);
}

.topbar {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  min-height: 70px;
  padding: 16px 18px 8px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar-slot {
  display: flex;
  align-items: center;
}

.topbar-slot.right {
  justify-content: flex-end;
}

.home-hero {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 20px 20px 17px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(135deg, rgba(255, 138, 42, 0.34), rgba(255, 79, 56, 0.12) 44%, rgba(66, 212, 189, 0.12)),
    #111113;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: auto -12% -44% 28%;
  height: 210px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 176, 0, 0.32), transparent 64%);
  pointer-events: none;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  pointer-events: none;
}

.hero-tools,
.brand-lockup,
.hero-stats {
  position: relative;
  z-index: 1;
}

.hero-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.brand-lockup {
  display: inline-flex;
  width: fit-content;
  gap: 8px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 250, 243, 0.88);
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
}

.brand-lockup span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #16100a;
  background: var(--accent);
}

.brand-lockup .icon {
  width: 15px;
  height: 15px;
}

.home-hero p {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: rgba(255, 250, 243, 0.66);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 60px;
  font-weight: 190;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.hero-detail {
  position: relative;
  z-index: 1;
  max-width: 320px;
  color: rgba(255, 250, 243, 0.78);
  line-height: 1.35;
  font-size: 15px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.hero-stats span {
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 250, 243, 0.62);
  font-size: 11px;
  text-align: center;
}

.hero-stats b {
  color: var(--text);
  font-size: 15px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button,
.text-button,
.small-button,
.primary-button,
.danger-button,
.preview-dock button,
.pin-pad button,
.day-pill,
.segmented button {
  border: 0;
  color: var(--text);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
}

.icon-button.accent {
  color: #1a1109;
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(255, 138, 42, 0.3);
}

.icon-button.glass {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
}

.text-button {
  padding: 8px 0;
  color: var(--accent);
  background: transparent;
  font-size: 15px;
}

.text-button.strong {
  font-weight: 700;
}

.text-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.alarm-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 104px;
}

.alarm-row {
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: 5px 1fr auto auto;
  gap: 13px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px 14px 14px 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
    #151417;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.alarm-row.muted {
  opacity: 0.58;
  background: #131315;
}

.alarm-rail {
  align-self: stretch;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent-hot));
}

.alarm-row.soft .alarm-rail {
  background: linear-gradient(#42d4bd, #7ed7ff);
}

.alarm-row.steady .alarm-rail {
  background: linear-gradient(#ffbc5c, #ff8a2a);
}

.alarm-row.force .alarm-rail {
  background: linear-gradient(#ff4f38, #ffb000);
}

.alarm-main {
  min-width: 0;
}

.time {
  font-size: 50px;
  font-weight: 250;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.alarm-kicker {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.alarm-kicker span:first-child {
  color: var(--accent);
}

.alarm-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alarm-meta .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.ringing {
  color: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

.switch {
  width: 54px;
  height: 32px;
  padding: 3px;
  border-radius: 999px;
  background: #454a55;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}

.switch span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  transition: transform 180ms ease;
}

.switch.on {
  background: linear-gradient(135deg, #ffb000, var(--accent));
}

.switch.on span {
  transform: translateX(22px);
}

.preview-dock {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-dock button,
.primary-button {
  min-height: 54px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(36, 33, 39, 0.92);
  font-weight: 700;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.preview-dock .dock-primary {
  color: #1b1008;
  background: linear-gradient(135deg, #ffb000, var(--accent));
}

.primary-button {
  width: 100%;
  background: linear-gradient(135deg, #ffb000, var(--accent));
  color: #1e1208;
}

.empty-state {
  flex: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 50px;
  height: 50px;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
}

.empty-state p {
  max-width: 280px;
  margin: 0;
}

.form-stack {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.editor-shell {
  background:
    linear-gradient(180deg, rgba(66, 212, 189, 0.1), transparent 34%),
    rgba(12, 12, 14, 0.97);
}

.editor-intro {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 18px 0;
}

.editor-intro > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  color: #15100b;
  background: linear-gradient(135deg, #42d4bd, #ffb000);
}

.editor-intro strong {
  display: block;
  font-size: 18px;
}

.editor-intro p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field,
.info-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--surface);
}

.featured-field {
  border-color: rgba(255, 138, 42, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 138, 42, 0.15), rgba(66, 212, 189, 0.06)),
    var(--surface);
}

.field > span,
.inline-grid label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--subtle);
  line-height: 1.4;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  padding: 0 12px;
}

.time-field input {
  height: 88px;
  font-size: 48px;
  font-weight: 300;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.24);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-pill {
  aspect-ratio: 1;
  border-radius: 999px;
  background: #303641;
  font-size: 12px;
  font-weight: 800;
}

.day-pill.selected {
  color: #1d1208;
  background: linear-gradient(135deg, #ffb000, var(--accent));
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: #101319;
}

.segmented button {
  min-height: 42px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented button.selected {
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.segmented.compact {
  max-width: 180px;
}

.pin-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.small-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-2);
}

.danger-button {
  min-height: 50px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: rgba(255, 93, 93, 0.14);
  color: var(--danger);
  font-weight: 800;
}

.inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.inline-grid label {
  display: grid;
  gap: 8px;
}

.info-panel {
  color: var(--muted);
  line-height: 1.45;
}

.sheet-backdrop,
.dialog-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.46);
}

.bottom-sheet {
  width: 100%;
  padding: 10px 20px 24px;
  border-radius: 28px 28px 0 0;
  background: #151922;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.4);
}

.sheet-handle {
  width: 46px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #4d5664;
}

.sheet-header {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  text-align: center;
}

.pin-caption,
.error-line {
  margin: 8px 0;
  text-align: center;
  color: var(--muted);
}

.error-line {
  min-height: 20px;
  color: var(--danger);
}

.dark-shell {
  background: #050608;
}

.alarm-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 28px 28px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 79, 56, 0.32), transparent 28%),
    radial-gradient(circle at 50% 62%, rgba(255, 176, 0, 0.16), transparent 34%),
    linear-gradient(#030303 0%, #1b1211 100%);
}

.alarm-aura {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 999px;
  background:
    conic-gradient(from 0deg, rgba(255, 79, 56, 0.05), #ff4f38, #ffb000, rgba(255, 79, 56, 0.05));
  animation: spin 5s linear infinite;
}

.alarm-aura::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: #080506;
}

.alarm-core {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #1b1008;
  background: linear-gradient(135deg, #ffb000, var(--accent));
  box-shadow: 0 0 50px rgba(255, 79, 56, 0.38);
}

.alarm-core .icon {
  width: 34px;
  height: 34px;
}

.alarm-copy {
  display: grid;
  justify-items: center;
  text-align: center;
}

.alarm-copy span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.alarm-time {
  font-size: 62px;
  font-weight: 150;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.alarm-label {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 22px;
}

.alarm-screen p {
  margin: 14px 0 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 24px;
  margin: 10px 0 16px;
}

.pin-display span {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.pin-display span.filled {
  border-color: #fff;
  background: #fff;
}

.pin-pad {
  width: min(100%, 258px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-pad button {
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  color: #fff;
  font-size: 27px;
  font-weight: 350;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 24px rgba(0, 0, 0, 0.26);
}

.pin-pad button:active {
  background: rgba(255, 255, 255, 0.22);
}

.alarm-spacer {
  flex: 1;
}

.emergency-link {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  text-decoration: underline;
}

.dialog-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dialog {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: #171b22;
}

.dialog h2,
.dialog p {
  margin: 0;
}

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

.briefing-shell {
  background: #111;
}

.briefing-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 34px 28px 32px;
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.1) 36%, rgba(0, 0, 0, 0.82)),
    url("./assets/briefing-bg.png") center / cover;
}

.briefing-badge {
  width: fit-content;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  align-self: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 800;
}

.briefing-badge .icon {
  width: 16px;
  height: 16px;
  color: #8ff0c7;
}

.briefing-top h1 {
  margin: 0 0 8px;
  font-size: 36px;
  line-height: 1.08;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.58);
}

.briefing-top p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.briefing-center {
  margin-top: auto;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.sun-ring {
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #231306;
  background: linear-gradient(135deg, #ffe08a, #ff8a2a);
  box-shadow: 0 18px 80px rgba(255, 138, 42, 0.42);
}

.sun-ring .icon {
  width: 42px;
  height: 42px;
}

.briefing-weather {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.72);
}

.briefing-weather .icon {
  width: 58px;
  height: 58px;
  color: #d9f0ff;
}

.briefing-weather strong {
  font-size: 52px;
  line-height: 1;
}

.briefing-weather small {
  color: rgba(255, 255, 255, 0.76);
}

blockquote {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(20, 24, 30, 0.48);
  backdrop-filter: blur(18px);
  line-height: 1.42;
}

.briefing-action .icon {
  width: 18px;
  height: 18px;
}

.shake {
  animation: shake 260ms ease-in-out;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.92);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 520px) {
  #app {
    padding: 0;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .time {
    font-size: 43px;
  }

  .alarm-row {
    grid-template-columns: 5px 1fr auto;
  }

  .ringing {
    display: none;
  }
}
