:root {
  color-scheme: dark;
  --ink: #edf4ff;
  --muted: #9ba8ba;
  --line: #253348;
  --paper: #0d1320;
  --panel: #141d2b;
  --field: #0f1726;
  --soft: #1b2738;
  --button: #182235;
  --event: #60a5fa;
  --blue: #60a5fa;
  --task: #2dd4bf;
  --danger: #f87171;
  --today: #2a2416;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light-theme {
  color-scheme: light;
  --ink: #18212f;
  --muted: #687385;
  --line: #d9dee8;
  --paper: #f7f8fb;
  --panel: #ffffff;
  --field: #ffffff;
  --soft: #edf1f7;
  --button: #ffffff;
  --event: #2563eb;
  --blue: #2563eb;
  --task: #0f766e;
  --danger: #b42318;
  --today: #fff1d6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 2;
}

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

h1 {
  font-size: 28px;
  line-height: 1.1;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions,
.calendar-toolbar,
.dialog-actions,
.dialog-actions > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.app-shell {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 360px;
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
}

.topbar > div:first-child {
  min-width: 0;
}

.calendar-panel,
.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-toolbar {
  justify-content: space-between;
  padding: 18px;
}

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

.weekday-row {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px 8px;
  text-align: center;
}

.calendar-grid {
  min-height: 640px;
}

.day-cell {
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 116px;
  padding: 10px;
  text-align: left;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell.outside {
  background: var(--soft);
  color: #8b95a5;
}

.day-cell.today {
  background: var(--today);
}

.day-cell.selected {
  outline: 3px solid #94b7ff;
  outline-offset: -3px;
}

.day-number {
  font-weight: 800;
}

.day-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 44px;
}

.pill {
  border-radius: 999px;
  color: #fff;
  display: block;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill.event {
  background: var(--event);
}

.pill.task {
  background: var(--task);
}

.pill.done {
  opacity: 0.55;
  text-decoration: line-through;
}

.sidebar {
  align-self: start;
  padding: 18px;
  position: sticky;
  top: 92px;
}

.selected-day {
  margin-bottom: 18px;
}

.tabs {
  background: var(--soft);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
  padding: 4px;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  padding: 9px 10px;
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 33, 47, 0.12);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.item {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 8px 1fr 40px;
  padding: 12px;
}

.item-marker {
  border-radius: 999px;
  height: 100%;
  min-height: 42px;
}

.item.event .item-marker {
  background: var(--event);
}

.item.task .item-marker {
  background: var(--task);
}

.item h3 {
  font-size: 15px;
  line-height: 1.25;
}

.item p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.item small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 7px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  border-radius: 8px;
  min-height: 40px;
}

.ghost-link {
  align-items: center;
  background: var(--button);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 800;
  min-height: 40px;
  padding: 0 13px;
  text-decoration: none;
}

.primary-button {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--paper);
  font-weight: 800;
  padding: 0 15px;
}

.robot-body {
  background: #070b12;
  color: #e8f2ff;
  min-height: 100vh;
  overflow: hidden;
}

.robot-display {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 42px);
}

.robot-screen {
  align-items: center;
  display: grid;
  gap: clamp(18px, 4vh, 34px);
  justify-items: center;
  min-height: calc(100vh - clamp(36px, 8vw, 84px));
  text-align: center;
}

.robot-face {
  align-items: center;
  display: flex;
  gap: clamp(32px, 10vw, 110px);
  justify-content: center;
  min-height: 180px;
  position: relative;
}

.robot-eye {
  animation: robotBlink 7s ease-in-out infinite;
  background: #7cff9b;
  border-radius: 999px;
  box-shadow: 0 0 32px rgba(124, 255, 155, 0.34);
  height: clamp(58px, 14vw, 116px);
  width: clamp(58px, 14vw, 116px);
}

.robot-screen.sleep .robot-eye {
  animation: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  height: clamp(36px, 7vw, 58px);
  position: relative;
  width: clamp(78px, 15vw, 122px);
}

.robot-screen.sleep .robot-eye::before {
  background: #7cff9b;
  border-radius: 0 0 999px 999px;
  content: "";
  height: 52%;
  left: 5%;
  position: absolute;
  top: 36%;
  transform: rotate(-8deg);
  width: 90%;
}

.robot-screen.sleep .robot-eye::after {
  background: var(--paper);
  border-radius: 0 0 999px 999px;
  content: "";
  height: 48%;
  left: 10%;
  position: absolute;
  top: 21%;
  transform: rotate(-8deg);
  width: 80%;
}

.robot-screen.sleep .robot-eye:nth-child(2)::before {
  transform: rotate(8deg);
}

.robot-screen.sleep .robot-eye:nth-child(2)::after {
  transform: rotate(8deg);
}

.robot-screen.alert .robot-eye {
  animation: robotGlow 2.4s ease-in-out infinite, robotBlink 7s ease-in-out infinite;
}

.robot-status {
  display: grid;
  gap: 10px;
}

.robot-kicker {
  color: #7cff9b;
  font-size: clamp(15px, 2vw, 22px);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.robot-title {
  font-size: clamp(34px, 8vw, 86px);
  line-height: 1;
}

.robot-subtitle {
  color: #a9b8ca;
  font-size: clamp(17px, 3vw, 30px);
}

.robot-alert-card,
.robot-detail-card {
  background: #101a2a;
  border: 1px solid #263650;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  max-width: 860px;
  padding: clamp(20px, 4vw, 42px);
  width: min(92vw, 860px);
}

.robot-alert-card {
  cursor: pointer;
}

.robot-detail-card {
  display: grid;
  gap: 22px;
  text-align: left;
}

.robot-upcoming-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}

.robot-upcoming-item {
  background: #0b1220;
  border: 1px solid #223047;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.robot-upcoming-item strong {
  color: #e8f2ff;
  font-size: clamp(18px, 3vw, 28px);
}

.robot-upcoming-item span {
  color: #a9b8ca;
  font-size: clamp(14px, 2vw, 20px);
}

.robot-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.robot-detail-grid div,
.robot-notes {
  background: #0b1220;
  border: 1px solid #223047;
  border-radius: 8px;
  padding: 14px;
}

.robot-label {
  color: #7cff9b;
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.robot-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.robot-action {
  background: #7cff9b;
  border: 0;
  border-radius: 8px;
  color: #07111e;
  font-weight: 900;
  min-height: 54px;
  padding: 0 16px;
}

.robot-action.secondary {
  background: #1d2b40;
  color: #e8f2ff;
}

.robot-hidden {
  display: none;
}

@keyframes robotGlow {
  0%,
  100% {
    box-shadow: 0 0 26px rgba(124, 255, 155, 0.34);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 58px rgba(124, 255, 155, 0.7);
    transform: scale(1.04);
  }
}

@keyframes robotBlink {
  0%,
  88%,
  92%,
  100% {
    transform: scaleY(1);
  }

  90% {
    transform: scaleY(0.12);
  }
}

.ghost-button {
  background: var(--button);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  padding: 0 15px;
}

.danger-button {
  background: var(--button);
  border: 1px solid #f1b5af;
  color: var(--danger);
  font-weight: 800;
  padding: 0 15px;
}

.icon-button {
  align-items: center;
  background: var(--button);
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  font-size: 22px;
  font-weight: 700;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 40px;
}

.menu-button {
  flex-direction: column;
  gap: 4px;
}

.menu-button span {
  background: var(--ink);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 18px;
}

.file-button input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.settings-row span {
  display: grid;
  gap: 4px;
}

.settings-row small {
  color: var(--muted);
  font-size: 13px;
}

.settings-row b {
  color: var(--blue, #60a5fa);
}

.simulator-body {
  background: #070b12;
  color: #edf4ff;
}

.simulator-topbar {
  align-items: center;
  border-bottom: 1px solid #1d2a3c;
  display: flex;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 36px);
}

.simulator-shell {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(466px, auto) minmax(280px, 360px);
  justify-content: center;
  padding: 28px 18px 40px;
}

.round-device {
  background: #05070b;
  border: 10px solid #02030a;
  border-radius: 50%;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px #273349;
  height: 486px;
  padding: 10px;
  width: 486px;
}

.round-screen {
  background: radial-gradient(circle at 50% 45%, #111b2c 0, #080d17 62%, #03060b 100%);
  border-radius: 50%;
  cursor: pointer;
  height: 466px;
  overflow: hidden;
  position: relative;
  user-select: none;
  width: 466px;
}

.sim-page {
  align-items: center;
  display: none;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 44px 48px;
  position: absolute;
  text-align: center;
  width: 100%;
}

.sim-page.active {
  display: flex;
}

.sim-eyes {
  display: flex;
  gap: 64px;
  justify-content: center;
  margin-bottom: 26px;
  min-height: 96px;
  position: relative;
}

.sim-eyes span {
  animation: robotBlink 7s ease-in-out infinite;
  background: #7cff9b;
  border-radius: 999px;
  box-shadow: 0 0 32px rgba(124, 255, 155, 0.34);
  display: block;
  height: 92px;
  width: 92px;
}

.sim-eyes.sleep span {
  animation: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  height: 42px;
  margin-top: 0;
  position: relative;
  width: 86px;
}

.sim-eyes.sleep span::before {
  background: #7cff9b;
  border-radius: 0 0 999px 999px;
  content: "";
  height: 22px;
  left: 4px;
  position: absolute;
  top: 17px;
  transform: rotate(-8deg);
  width: 78px;
}

.sim-eyes.sleep span::after {
  background: #080d17;
  border-radius: 0 0 999px 999px;
  content: "";
  height: 20px;
  left: 9px;
  position: absolute;
  top: 9px;
  transform: rotate(-8deg);
  width: 68px;
}

.sim-eyes.sleep span:nth-child(2)::before {
  transform: rotate(8deg);
}

.sim-eyes.sleep span:nth-child(2)::after {
  transform: rotate(8deg);
}

.sim-eyes.awake span,
.sim-eyes.alert span {
  border-radius: 999px;
  height: 92px;
  width: 92px;
}

.sim-eyes.alert span {
  animation: robotGlow 2.2s ease-in-out infinite, robotBlink 7s ease-in-out infinite;
  box-shadow: 0 0 34px rgba(255, 69, 58, 0.45);
}

.sim-content {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 340px;
}

.sim-kicker {
  color: #9ba8ba;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sim-kicker.alert-text {
  color: #ff8b82;
}

.sim-page h2 {
  color: #ffffff;
  font-size: 30px;
  line-height: 1.05;
  max-width: 330px;
}

.sim-page p {
  color: #aeb9ca;
  font-size: 15px;
  line-height: 1.35;
}

.sim-event-pill {
  background: #111b2c;
  border: 1px solid #2a3950;
  border-radius: 18px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 14px 18px 14px 26px;
  position: relative;
  text-align: left;
  width: 310px;
}

.sim-event-pill::before {
  background: var(--event-color, #ff453a);
  border-radius: 999px;
  content: "";
  height: 42px;
  left: 10px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
}

.sim-event-pill strong {
  font-size: 17px;
}

.sim-event-pill span {
  color: #aeb9ca;
  font-size: 13px;
}

.sim-detail-list {
  display: grid;
  gap: 9px;
  margin: 16px 0 14px;
  text-align: left;
  width: 330px;
}

.sim-detail-list div {
  background: #111b2c;
  border: 1px solid #26354c;
  border-radius: 12px;
  padding: 10px 12px;
}

.sim-detail-list dt {
  color: #9ba8ba;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sim-detail-list dd {
  color: #edf4ff;
  font-size: 13px;
  margin: 4px 0 0;
}

.sim-action-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 2px;
  width: 330px;
}

.sim-action-row span {
  background: #182235;
  border-radius: 999px;
  color: #edf4ff;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 13px;
}

.simulator-panel {
  background: #111827;
  border: 1px solid #253348;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.sim-control-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(24, 33, 47, 0.26);
  max-width: 560px;
  padding: 0;
  width: calc(100vw - 32px);
}

dialog::backdrop {
  background: rgba(24, 33, 47, 0.45);
}

form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

label,
fieldset {
  display: grid;
  gap: 7px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

legend,
label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.helper-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.calendar-picker {
  display: grid;
  gap: 12px;
}

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

.picker-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-choice-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
}

.calendar-choice {
  align-items: center;
  display: flex;
  gap: 10px;
}

.calendar-choice input {
  min-height: auto;
  width: 18px;
}

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

.done-row {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.done-row input {
  min-height: auto;
  width: 18px;
}

.dialog-actions {
  justify-content: space-between;
  margin-top: 4px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .simulator-shell {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar {
    position: static;
  }

  .calendar-panel {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  body {
    background: #0b1220;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 16px 16px 12px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
  }

  .topbar-actions .primary-button {
    min-width: 92px;
    padding: 0 12px;
  }

  .app-shell {
    gap: 14px;
    padding: 14px 12px 28px;
  }

  .simulator-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .simulator-shell {
    padding: 18px 8px 30px;
  }

  .round-device {
    height: min(486px, calc(100vw - 20px));
    padding: 8px;
    width: min(486px, calc(100vw - 20px));
  }

  .round-screen {
    height: 100%;
    width: 100%;
  }

  .sim-page {
    padding: 38px 34px;
  }

  .sim-eyes {
    gap: 38px;
    margin-bottom: 20px;
    min-height: 82px;
  }

  .sim-eyes.awake span,
  .sim-eyes.alert span {
    width: 74px;
  }

  .sim-eyes.awake span,
  .sim-eyes.alert span {
    height: 74px;
  }

  .sim-eyes.sleep span {
    height: 36px;
    width: 72px;
  }

  .sim-eyes.sleep {
    min-height: 82px;
  }

  .sim-page h2 {
    font-size: 26px;
  }

  .sim-event-pill,
  .sim-detail-list {
    width: min(300px, 76vw);
  }

  .calendar-panel,
  .sidebar {
    border-radius: 8px;
  }

  .calendar-toolbar {
    padding: 14px;
  }

  .calendar-toolbar h2 {
    font-size: 22px;
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(48px, 1fr));
  }

  .weekday-row {
    font-size: 11px;
    padding-inline: 4px;
  }

  .day-cell {
    gap: 5px;
    min-height: 66px;
    padding: 7px;
  }

  .day-number {
    font-size: 14px;
  }

  .pill {
    font-size: 10px;
    padding: 3px 6px;
  }

  .day-items {
    gap: 4px;
    min-height: 28px;
  }

  .sidebar {
    padding: 16px;
  }

  .selected-day h2 {
    font-size: 23px;
  }

  .item {
    grid-template-columns: 7px 1fr 38px;
    padding: 10px;
  }

  .item h3 {
    font-size: 14px;
  }

  .item p,
  .item small {
    font-size: 12px;
  }

  dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .form-grid,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    align-items: stretch;
    display: grid;
  }

  .dialog-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
