﻿@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Medium.ttf") format("truetype");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Bold.ttf") format("truetype");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans";
  src: url("/static/fonts/HarmonyOS_Sans_Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F3F1FF;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --surface-muted: #F0F2F4;
  --input-bg: #ffffff;
  --text: #17224B;
  --muted: #9A89EB;
  --line: #9890C2;
  --primary: #9284D6;
  --primary-dark: #695AB2;
  --deep-primary: var(--primary-dark);
  --nav-bg: #FAF9FF;
  --nav-selected-bg: #ffffff;
  --nav-selected-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.86), inset 0 -1px 0 rgba(105, 90, 178, 0.08);
  --topbar-bg: linear-gradient(180deg, rgba(243, 241, 255, 0.94), rgba(243, 241, 255, 0.74));
  --toggle-on: #EAFF68;
  --toggle-off: #cfd5dc;
  --toggle-knob: #ffffff;
  --wizard-bg: rgba(245, 243, 255, 0.9);
  --wizard-shadow: inset 6px 6px 14px rgba(105, 90, 178, 0.10), inset -6px -6px 14px rgba(255, 255, 255, 0.86);
  --wizard-muted: rgba(105, 90, 178, 0.34);
  --wizard-disabled: rgba(23, 34, 75, 0.48);
  --bright-action-text: #17224B;
  --danger: #B84040;
  --danger-bg: #FFDDDD;
  --warning: #FFCE00;
  --frozen: #EAFF68;
  --frozen-soft: #FDFFF0;
  --frozen-line: #F8FCDA;
  --calendar-event: #F8FCDA;
  --deleted-text: #7A7F8C;
  --history-item-bg: var(--surface);
  --history-deleted-bg: #ffffff;
  --history-deleted-stripe: rgba(152, 144, 194, 0.1);
  --history-item-shadow: 0 14px 30px rgba(105, 90, 178, 0.16), 0 4px 10px rgba(23, 34, 75, 0.08);
  --history-item-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --extension-row-bg: rgba(253, 253, 255, 0.96);
  --progress-ring-plate: #F4F1FF;
  --progress-track-edge: #D4CFEA;
  --progress-track-mid: #E1DDF2;
  --progress-track-core: #ECE8F8;
  --progress-track-highlight: #F1EEFA;
  --frozen-track-edge: #D4DE92;
  --frozen-track-mid: #E2ECA9;
  --frozen-track-core: #EEF6C3;
  --frozen-track-highlight: #F4FBD2;
  --shadow: 0 18px 42px rgba(105, 90, 178, 0.2), 0 5px 14px rgba(23, 34, 75, 0.1);
  --shadow-card: var(--shadow);
  --shadow-soft: 0 10px 24px rgba(105, 90, 178, 0.16), 0 3px 9px rgba(23, 34, 75, 0.08);
  --shadow-control: 0 6px 14px rgba(105, 90, 178, 0.14), 0 2px 5px rgba(23, 34, 75, 0.08);
  --shadow-inset: inset 0 3px 9px rgba(105, 90, 178, 0.16);
  --shadow-input: inset 0 4px 10px rgba(105, 90, 178, 0.18), inset 0 1px 3px rgba(23, 34, 75, 0.08);
  --card-radius: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #19191B;
  --panel: #343437;
  --surface: #2C2C2F;
  --surface-soft: #3A3A3D;
  --surface-muted: #262629;
  --input-bg: #28282B;
  --text: #FAF9FF;
  --muted: #B9B0DA;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #A681FF;
  --primary-dark: #C7B6FF;
  --deep-primary: var(--primary-dark);
  --nav-bg: #2A2A2D;
  --nav-selected-bg: #3B3941;
  --nav-selected-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.28);
  --topbar-bg: linear-gradient(180deg, rgba(25, 25, 27, 0.96), rgba(25, 25, 27, 0.76));
  --toggle-on: #EAFF68;
  --toggle-off: #565961;
  --toggle-knob: #ffffff;
  --wizard-bg: #2A292E;
  --wizard-shadow: inset 6px 6px 14px rgba(0, 0, 0, 0.34), inset -5px -5px 12px rgba(255, 255, 255, 0.04);
  --wizard-muted: rgba(185, 176, 218, 0.42);
  --wizard-disabled: rgba(250, 249, 255, 0.42);
  --bright-action-text: #17224B;
  --danger: #FF7575;
  --danger-bg: #4E2528;
  --warning: #FFD53D;
  --frozen: #EAFF68;
  --frozen-soft: #303421;
  --frozen-line: rgba(234, 255, 104, 0.24);
  --calendar-event: #EAFF68;
  --deleted-text: #A9ABB5;
  --history-item-bg: #2B2B2E;
  --history-deleted-bg: #28282B;
  --history-deleted-stripe: rgba(255, 255, 255, 0.045);
  --history-item-shadow: 0 18px 34px rgba(0, 0, 0, 0.36), 0 8px 18px rgba(105, 90, 178, 0.08);
  --history-item-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --extension-row-bg: #303033;
  --progress-ring-plate: #242329;
  --progress-track-edge: #4A4554;
  --progress-track-mid: #3D3847;
  --progress-track-core: #322F3B;
  --progress-track-highlight: #28262E;
  --frozen-track-edge: #5C6A38;
  --frozen-track-mid: #4D5731;
  --frozen-track-core: #3E452B;
  --frozen-track-highlight: #313426;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.46), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  --shadow-card: var(--shadow);
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.36), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  --shadow-control: 0 8px 18px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  --shadow-inset: inset 0 4px 12px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-input: inset 0 5px 14px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "HarmonyOS Sans", Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: rgba(146, 132, 214, 0.12);
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border-radius: 999px;
  text-align: center;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(152, 144, 194, 0.18) 0 5px,
      rgba(255, 255, 255, 0) 5px 15px
    );
}

.warning-button:disabled {
  background-color: #FFF9D6;
  background-image:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 206, 0, 0.22) 0 5px,
      rgba(255, 255, 255, 0) 5px 15px
    );
  color: #7A6200;
}

select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1040px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  min-height: 54px;
  margin:
    calc(8px + env(safe-area-inset-top, 0px))
    auto
    0;
  padding:
    7px
    7px
    7px
    22px;
  border-radius: 999px;
  background: var(--surface-soft);
  border-bottom: 0;
  box-shadow: var(--shadow-control);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-mode-selector {
  position: static;
  flex: 0 0 auto;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  opacity: 0.82;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.theme-mode-selector:hover,
.theme-mode-selector:focus-visible {
  color: var(--primary-dark);
  opacity: 1;
}

.theme-mode-selector:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.theme-mode-selector [data-theme-icon] {
  display: none !important;
  grid-area: 1 / 1;
  place-items: center;
}

.theme-mode-selector[data-current-theme-mode="light"] [data-theme-icon="light"],
.theme-mode-selector[data-current-theme-mode="dark"] [data-theme-icon="dark"],
.theme-mode-selector[data-current-theme-mode="system"] [data-theme-icon="system"] {
  display: grid !important;
}

.theme-mode-selector:not([data-current-theme-mode]) [data-theme-icon="system"] {
  display: grid !important;
}

.theme-mode-selector svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-mode-selector [data-theme-icon="dark"] svg {
  fill: currentColor;
  stroke-width: 0;
}

.theme-mode-selector.theme-mode-animate span {
  animation: theme-icon-cycle 240ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

@keyframes theme-icon-cycle {
  0% {
    opacity: 0;
    transform: rotate(-22deg) scale(0.72);
  }
  65% {
    opacity: 1;
    transform: rotate(5deg) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

.topnav,
.button-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topnav form {
  margin: 0;
}

.bottom-nav {
  --selected-index: 0;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(330px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin: 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--nav-bg);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  isolation: isolate;
}

.bottom-nav:has(a:nth-child(2).selected) {
  --selected-index: 1;
}

.bottom-nav:has(a:nth-child(3).selected) {
  --selected-index: 2;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 10px;
  z-index: 0;
  width: calc((100% - 28px) / 3);
  border-radius: 999px;
  background: var(--nav-selected-bg);
  box-shadow:
    0 12px 24px rgba(105, 90, 178, 0.24),
    0 4px 10px rgba(23, 34, 75, 0.12),
    var(--nav-selected-highlight);
  transform: translateX(calc(var(--selected-index) * (100% + 4px)));
  transition: transform 180ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.bottom-nav a {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  border-radius: 999px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  transition: color 140ms ease;
}

.bottom-nav a.selected {
  background: transparent;
  color: var(--primary-dark);
}

.bottom-nav-icon {
  display: block;
  width: 21px;
  height: 21px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.bottom-nav-icon.home {
  mask-image: url("/static/icons/tab-home.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-home.svg?v=20260602-80");
}

.bottom-nav a.selected .bottom-nav-icon.home {
  mask-image: url("/static/icons/tab-home-filled.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-home-filled.svg?v=20260602-80");
}

.bottom-nav-icon.history {
  mask-image: url("/static/icons/tab-history.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-history.svg?v=20260602-80");
}

.bottom-nav a.selected .bottom-nav-icon.history {
  mask-image: url("/static/icons/tab-history-filled.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-history-filled.svg?v=20260602-80");
}

.bottom-nav-icon.me {
  mask-image: url("/static/icons/tab-me.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-me.svg?v=20260602-80");
}

.bottom-nav a.selected .bottom-nav-icon.me {
  mask-image: url("/static/icons/tab-me-filled.svg?v=20260602-80");
  -webkit-mask-image: url("/static/icons/tab-me-filled.svg?v=20260602-80");
}

.profile-card {
  display: grid;
  justify-items: center;
  gap: 22px;
  min-height: 240px;
  align-content: center;
  text-align: center;
}

.profile-card h1 {
  margin: 0;
}

.account-card {
  align-content: start;
  gap: 28px;
  min-height: 360px;
}

.profile-username {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  color: var(--text);
}

.avatar-upload {
  margin: 0;
}

.profile-avatar {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--primary-dark);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.profile-avatar:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar > span[aria-hidden="true"] {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

.profile-username span {
  color: var(--muted);
  font-weight: 700;
}

.profile-username strong {
  color: var(--primary-dark);
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(420px, 100%);
  min-height: 58px;
  padding: 12px 18px 12px 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-control);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.avatar-crop-modal-inner {
  gap: 14px;
}

.avatar-crop-modal-inner p {
  margin: -4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.avatar-crop-canvas {
  display: block;
  width: min(300px, 100%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  cursor: grab;
  touch-action: none;
}

.avatar-crop-canvas.dragging {
  cursor: grabbing;
}

.avatar-zoom-control {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.avatar-zoom-control input {
  width: 100%;
  accent-color: var(--primary);
}

.avatar-crop-actions {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  margin-top: 10px;
}

.avatar-crop-actions button {
  width: 100%;
  min-height: 48px;
}

.secondary-button.profile-edit-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-color: var(--primary);
  background: var(--surface);
  color: var(--primary);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(420px, 100%);
}

.profile-actions form {
  display: grid;
  margin: 0;
}

.profile-actions .primary-button,
.profile-actions .secondary-button,
.profile-actions .primary-link {
  width: 100%;
  min-height: 52px;
}

.logout-row {
  display: grid;
  width: min(420px, 100%);
  margin: 0;
}

.logout-row .danger-button {
  width: 100%;
  min-height: 52px;
}

.profile-form {
  width: min(420px, 100%);
}

.profile-form label {
  text-align: left;
}

.profile-module {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  text-align: left;
}

.profile-module h2 {
  margin: 0;
  text-align: center;
}

.profile-menu {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
}

.profile-menu .secondary-button,
.profile-back-button {
  width: min(420px, 100%);
  min-height: 52px;
}

.invite-code-module {
  text-align: center;
}

.invite-number-seal {
  width: 100%;
}

.invite-code-display {
  display: grid;
  width: 100%;
  min-height: 112px;
  place-items: center;
  padding: 8px 14px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-control);
  color: var(--text);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0;
}

.invite-number-seal .secondary-button {
  width: 100%;
  min-height: 52px;
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.backup-actions form {
  display: grid;
  margin: 0;
}

.backup-actions .primary-link,
.backup-actions .secondary-button {
  width: 100%;
  min-height: 52px;
}

.backup-upload {
  cursor: pointer;
}

.backup-actions .backup-export-button {
  background: var(--frozen);
  color: var(--bright-action-text);
  -webkit-text-fill-color: var(--bright-action-text);
  box-shadow: 0 8px 18px rgba(214, 242, 56, 0.34), var(--shadow-control);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.backup-actions .backup-export-button:hover {
  background: #E4FA58;
  color: var(--bright-action-text);
  -webkit-text-fill-color: var(--bright-action-text);
  box-shadow: 0 10px 22px rgba(214, 242, 56, 0.42), var(--shadow-control);
}

.profile-form input:not([type]),
.profile-form input[type="text"],
.profile-form input[type="password"] {
  width: 100%;
  height: 56px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 20px;
}

.centered-actions {
  justify-content: center;
}

.centered-actions form {
  margin: 0;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  width: 100%;
}

.detail-return-button {
  display: flex;
  width: 100%;
  min-width: 0;
}

.page {
  width: min(1040px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin: 28px auto 64px;
}

.workspace,
.active-shell,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}

.workspace {
  padding: 24px;
  margin-bottom: 24px;
}

.workspace.compact {
  padding: 20px;
}

.empty-session-card {
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto;
  gap: 32px;
  min-height: 360px;
  text-align: center;
}

.empty-session-card h1 {
  align-self: center;
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1;
  font-weight: 800;
}

.empty-session-card .primary-button {
  width: 100%;
  min-height: 52px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0 0 6px;
}

.section-heading p,
.help-text,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.create-form {
  display: grid;
  gap: 20px;
}

.workspace.create-workspace {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.create-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.create-card .section-heading {
  margin-bottom: 0;
}

.create-card .form-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.form-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.segmented,
.radio-grid,
.duration-row,
.number-seal,
.tick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.segmented label,
.radio-grid label,
.tick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
}

.seal-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.seal-choice-row label {
  position: relative;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
}

.seal-choice-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seal-choice-row label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.tick-row {
  width: fit-content;
  margin-bottom: 14px;
}

.number-seal {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 100%;
  margin-top: 8px;
}

.duration-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: min(100%, 520px);
  margin-bottom: 12px;
}

.duration-row label {
  display: grid;
  grid-template-rows: auto auto;
  flex: 1 1 0;
  align-items: center;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  font-weight: 400;
  text-align: center;
}

.duration-row input[type="number"] {
  width: 100%;
  height: 52px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.duration-row input[type="number"]::-webkit-inner-spin-button,
.duration-row input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.field-label {
  margin: 12px 0 8px;
  color: var(--muted);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
}

.switch-row:has([data-hide-time-toggle]) {
  align-items: flex-start;
}

.switch-row:has([data-hide-time-toggle]) > div {
  margin-top: 4px;
}

.switch-row:has([data-hide-time-toggle]) .ios-switch {
  margin-top: 4px;
}

.switch-title {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 700;
}

.display-mode-capsules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.progress-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  padding: 8px 18px;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.display-mode-capsules .progress-capsule {
  margin-top: 0;
}

.progress-capsule input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.progress-capsule:has(input:checked) {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary);
  color: #fff;
}

.ios-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
}

.ios-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ios-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--toggle-off);
  transition: background 0.2s ease;
}

.ios-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--toggle-knob);
  box-shadow: 0 2px 6px rgba(20, 24, 30, 0.18);
  transition: transform 0.2s ease;
}

.ios-switch input:checked + span {
  background: var(--toggle-on);
}

.ios-switch input:checked + span::after {
  transform: translateX(20px);
}

.ios-switch input:focus-visible + span {
  outline: 2px solid var(--toggle-on);
  outline-offset: 3px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

select,
textarea {
  background: var(--input-bg);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.number-seal input {
  width: 100%;
  height: 112px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  text-align: center;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0;
}

.number-seal .secondary-button {
  width: 100%;
  min-height: 52px;
}

.seal-create-card .number-seal [data-reshuffle] {
  background: var(--frozen);
  color: var(--bright-action-text);
  -webkit-text-fill-color: var(--bright-action-text);
  box-shadow: 0 10px 24px rgba(234, 255, 104, 0.36), 0 4px 10px rgba(105, 90, 178, 0.12);
}

.seal-create-card > .wide-button {
  min-height: 52px;
}

.photo-dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  margin-top: 8px;
  padding: 22px;
  border: 2px dashed #b8c0ca;
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
}

.photo-dropzone:hover {
  border-color: #b8c0ca;
  background: var(--surface-soft);
}

.photo-placeholder {
  font-weight: 700;
  color: var(--text);
}

.photo-preview {
  max-width: min(420px, 100%);
  max-height: 260px;
  border-radius: var(--card-radius);
  border: 1px solid var(--line);
  object-fit: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.warning-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}

.primary-button,
.primary-link {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.primary-link:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.warning-button {
  background: #FFF9D6;
  color: #594700;
  border-color: #FFE580;
}

.danger-text-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  text-align: center;
}

.danger-text-button {
  color: var(--danger);
}

.link-button {
  color: var(--primary);
}

.wide-button {
  width: 100%;
  justify-self: stretch;
}

.message {
  padding: 10px 12px;
  border-radius: var(--card-radius);
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(24px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(24px + env(safe-area-inset-left, 0px));
}

.login-panel {
  width: min(380px, 100%);
  padding: 24px;
}

.login-panel h1 {
  margin-top: 0;
}

.login-panel input:not([type]),
.login-panel input[type="text"],
.login-panel input[type="password"] {
  width: 100%;
  height: 56px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 20px;
}

.login-panel .primary-button {
  width: 100%;
  min-height: 56px;
  margin-top: 24px;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--text);
  text-align: center;
}

.auth-switch a {
  color: var(--primary-dark);
  font-weight: 700;
}

.auth-inline-action {
  display: block;
  margin: 18px auto 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.invite-code-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.login-panel input.invite-code-cell[type="text"] {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0 2px;
  border-radius: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 6px;
}

.active-shell {
  position: relative;
  min-height: 520px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 20px;
  padding: 24px;
}

.active-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-align: center;
}

.display-menu {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 4;
  width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.display-menu button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-align: center;
}

.display-menu button.selected {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.active-status {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  min-height: 260px;
}

.progress-ring-mode .active-status {
  min-height: 340px;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 12px;
  width: min(560px, 100%);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.time-card {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 112px;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
}

.time-card strong {
  font-size: clamp(34px, 7vw, 62px);
  line-height: 1;
}

.time-card span {
  color: var(--text);
  font-weight: 700;
}

.progress-track {
  position: relative;
  grid-area: 1 / 1;
  width: min(260px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
}

.progress-track::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: 0;
  border-radius: 50%;
  background: var(--progress-ring-plate);
  box-shadow: 0 6px 12px rgba(105, 90, 178, 0.14), 0 2px 5px rgba(23, 34, 75, 0.05);
}

.progress-ring {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-track,
.progress-fill {
  fill: none;
  stroke-width: 12;
}

.progress-ring-track {
  stroke: url("#progress-track-gradient");
  filter: drop-shadow(0 0 4px rgba(105, 90, 178, 0.07));
}

#progress-track-gradient stop:nth-child(1),
#progress-track-gradient stop:nth-child(8) {
  stop-color: var(--progress-track-edge);
}

#progress-track-gradient stop:nth-child(2),
#progress-track-gradient stop:nth-child(7) {
  stop-color: var(--progress-track-mid);
}

#progress-track-gradient stop:nth-child(3),
#progress-track-gradient stop:nth-child(6) {
  stop-color: var(--progress-track-core);
}

#progress-track-gradient stop:nth-child(4),
#progress-track-gradient stop:nth-child(5) {
  stop-color: var(--progress-track-highlight);
}

#frozen-progress-track-gradient stop:nth-child(1),
#frozen-progress-track-gradient stop:nth-child(8) {
  stop-color: var(--frozen-track-edge);
}

#frozen-progress-track-gradient stop:nth-child(2),
#frozen-progress-track-gradient stop:nth-child(7) {
  stop-color: var(--frozen-track-mid);
}

#frozen-progress-track-gradient stop:nth-child(3),
#frozen-progress-track-gradient stop:nth-child(6) {
  stop-color: var(--frozen-track-core);
}

#frozen-progress-track-gradient stop:nth-child(4),
#frozen-progress-track-gradient stop:nth-child(5) {
  stop-color: var(--frozen-track-highlight);
}

.progress-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1s ease-out;
}

.running-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  color: var(--text);
}

.progress-ring-mode .running-status {
  grid-area: 1 / 1;
  justify-self: center;
  align-self: center;
}

.pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

.unlock-ready {
  justify-self: center;
  text-align: center;
}

.unlock-ready .primary-button {
  min-width: 148px;
}

.unlock-ready p {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 700;
}

.active-manage-button {
  justify-self: center;
  min-width: 112px;
}

.active-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.temporary-unlock-mode .running-status {
  color: var(--text);
}

.temporary-unlock-shell {
  display: grid;
  gap: 24px;
}

.temporary-unlock-card {
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: clamp(24px, 6vw, 42px);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.temporary-unlock-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.8rem, 7vw, 3rem);
}

.temporary-unlock-card > strong {
  color: var(--deep-primary);
  font-size: clamp(2rem, 9vw, 4rem);
  line-height: 1;
}

.temporary-unlock-card form {
  width: 100%;
}

.temporary-seal-view {
  width: 100%;
  min-height: 180px;
}

.temporary-reseal-form {
  display: grid;
  gap: 18px;
  width: 100%;
  text-align: left;
}

.temporary-reseal-form h2 {
  font-size: 1.35rem;
}

.management-shell {
  display: grid;
  gap: 24px;
}

.management-section {
  display: grid;
  justify-items: stretch;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  text-align: left;
}

.management-section h2 {
  margin: 0;
}

.display-options {
  --selected-index: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: rgba(146, 132, 214, 0.1);
  box-shadow: var(--shadow-inset);
  isolation: isolate;
}

.display-options:has(button:nth-child(2).selected) {
  --selected-index: 1;
}

.display-options:has(button:nth-child(3).selected) {
  --selected-index: 2;
}

.display-options::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 0;
  width: calc((100% - 16px) / 3);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow-control);
  transform: translateX(calc(var(--selected-index) * (100% + 4px)));
  transition: transform 180ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.display-options button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: center;
  -webkit-text-fill-color: var(--text);
  box-shadow: none;
  transition: color 140ms ease, -webkit-text-fill-color 140ms ease;
}

.display-options button.selected {
  background: transparent;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: none;
}

.display-options button:disabled {
  opacity: 0.45;
}

.create-display-options {
  margin-top: 4px;
}

.create-display-lock-row {
  margin-top: 14px;
}

.management-switch {
  width: 100%;
  margin: 4px 0 0;
  background: var(--surface);
  text-align: left;
}

.ios-switch input:disabled + span {
  opacity: 0.7;
  cursor: not-allowed;
}

.danger-zone {
  border-color: #e8b9b9;
  background: var(--danger-bg);
}

.danger-zone h2 {
  color: var(--danger);
}

.emergency-wait-text {
  color: var(--text);
}

.danger-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.danger-actions .warning-button {
  width: 100%;
  justify-self: start;
}

.danger-actions .danger-button {
  width: 100%;
  justify-self: end;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--danger);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.modal {
  width: min(440px, calc(100% - 32px));
  border: 0;
  border-radius: var(--card-radius);
  padding: 0;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.modal-inner {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
  padding: 24px;
}

.modal-inner h2 {
  margin: 0;
}

.modal-cancel-button {
  width: min(360px, 100%);
  margin-top: 18px;
}

.modal-inner .message {
  width: min(360px, 100%);
  text-align: center;
}

.modal-inner .message.error {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.hold-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 0;
  border-radius: 50%;
  background: #FFF9D6;
  color: #594700;
  font-weight: 800;
  box-shadow:
    0 9px 18px rgba(224, 173, 0, 0.24),
    0 4px 8px rgba(105, 90, 178, 0.12),
    inset 0 3px 0 rgba(255, 255, 255, 0.72),
    inset 0 -3px 7px rgba(224, 173, 0, 0.14);
}

.hold-button span {
  position: relative;
  z-index: 1;
}

.hold-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.hold-ring-track,
.hold-ring-fill {
  fill: none;
  stroke-width: 10;
}

.hold-ring-track {
  stroke: url("#emergency-hold-track-gradient");
  filter: drop-shadow(0 0 3px rgba(224, 173, 0, 0.1));
}

.hold-ring-fill {
  stroke: var(--warning);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.emergency-note {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
}

.emergency-note span {
  color: var(--warning);
  font-weight: 800;
}

.emergency-note small {
  font-size: 13px;
  color: var(--muted);
}

.delete-slider {
  position: relative;
  width: min(360px, 100%);
  height: 56px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--danger-bg);
  border: 1px solid #e8b9b9;
  user-select: none;
  touch-action: none;
}

.delete-slider span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--danger);
  font-weight: 700;
  pointer-events: none;
}

.delete-slider button {
  position: absolute;
  left: 6px;
  top: 6px;
  display: grid;
  place-items: center;
  width: 92px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 7px 12px rgba(184, 64, 64, 0.28),
    0 3px 5px rgba(105, 90, 178, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 4px rgba(113, 35, 35, 0.16);
  transition: transform 0.2s ease;
}

.history-overview {
  --history-stat-value-size: 28px;
  display: grid;
  gap: 0;
}

.history-page-card {
  display: grid;
  gap: 22px;
}

.history-view-selector {
  --selected-index: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(146, 132, 214, 0.1);
  box-shadow: var(--shadow-inset);
  isolation: isolate;
}

.history-view-selector:has(label:nth-child(2).selected),
.history-view-selector:has(label:nth-child(2) input:checked) {
  --selected-index: 1;
}

.history-view-selector::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 0;
  width: calc((100% - 12px) / 2);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow-control);
  transform: translateX(calc(var(--selected-index) * (100% + 4px)));
  transition: transform 180ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.history-view-selector label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: color 140ms ease, -webkit-text-fill-color 140ms ease;
}

.history-view-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.history-view-selector label.selected,
.history-view-selector label:has(input:checked) {
  background: transparent;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: none;
}

.history-view-panel[hidden] {
  display: none;
}

.history-page-card .history-view-panel {
  min-width: 0;
}

.history-page-card .history-view-panel.is-entering {
  animation: history-panel-fade 160ms ease-out;
}

@keyframes history-panel-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-detail-card,
.calendar-panel {
  margin-bottom: 0;
}

.calendar-panel .section-heading,
.row-heading.history-list-heading {
  min-height: 28px;
  align-items: center;
  margin-bottom: 0;
}

.calendar-panel .section-heading h2,
.history-list-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.history-stat-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  align-content: center;
}

.history-stat-card span {
  color: var(--text);
  min-width: 0;
  font-weight: 700;
}

.history-stat-card strong {
  color: var(--primary);
  min-width: 0;
  overflow: hidden;
  font-size: var(--history-stat-value-size);
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.history-stat-card strong.warning {
  color: #E0AD00;
}

.calendar-panel {
  display: grid;
  gap: 14px;
}

.calendar-panel .history-stats {
  margin-bottom: 28px;
}

.calendar-frame {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-soft);
}

.calendar-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.calendar-heading h2 {
  margin: 0;
  text-align: center;
}

.calendar-month-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.calendar-month-button:first-child {
  justify-self: start;
}

.calendar-month-button:last-child {
  justify-self: end;
}

.calendar-add-mode .calendar-day:not(.empty) {
  cursor: pointer;
}

.calendar-add-mode .calendar-day:not(.empty)::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 8px;
  bottom: 4px;
  left: 8px;
  z-index: 4;
  border: 2px dashed rgba(248, 252, 218, 0.95);
  border-radius: 999px;
  pointer-events: none;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px 0;
}

.calendar-weekdays span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  overflow: visible;
}

.calendar-day.empty {
  background: transparent;
}

.calendar-day.has-event {
  color: #fff;
}

.calendar-day-number {
  position: relative;
  z-index: 2;
  transform: translateY(-3px);
}

.calendar-session-fill {
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  left: 4px;
  z-index: 0;
  border-radius: 999px;
  background: var(--primary);
}

.calendar-session-fill.emergency {
  background: var(--warning);
}

.calendar-session-fill.continues-from-previous {
  left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.calendar-session-fill.continues-to-next {
  right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.calendar-day.today::before {
  content: "";
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  left: 4px;
  z-index: 1;
  border-radius: 999px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.46) 0 4px,
    rgba(255, 255, 255, 0.12) 4px 8px
  );
  pointer-events: none;
}

.calendar-day.today.continues-from-previous::before {
  left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.calendar-day.today.continues-to-next::before {
  right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.calendar-day.today:not(.has-event)::before {
  background: repeating-linear-gradient(
    -45deg,
    rgba(146, 132, 214, 0.16) 0 4px,
    rgba(146, 132, 214, 0.05) 4px 8px
  );
}

.calendar-emergency-marker {
  position: absolute;
  left: 50%;
  bottom: 7px;
  z-index: 3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  border: 2px solid #fff;
  transform: translateX(-50%);
}

.calendar-user-event-marker {
  position: absolute;
  left: 50%;
  bottom: 7px;
  z-index: 3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--calendar-event);
  border: 2px solid var(--line);
  transform: translateX(-50%);
}

.calendar-day.has-custom-event.has-emergency .calendar-emergency-marker {
  transform: translateX(-125%);
}

.calendar-day.has-emergency .calendar-user-event-marker {
  transform: translateX(25%);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 24px;
  height: 14px;
  border-radius: 999px;
}

.legend-swatch.primary {
  background: var(--primary);
}

.legend-swatch.emergency {
  background: var(--warning);
}

.legend-swatch.today {
  background: repeating-linear-gradient(
    -45deg,
    rgba(146, 132, 214, 0.18) 0 4px,
    rgba(146, 132, 214, 0.05) 4px 8px
  );
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.user-event {
  background: var(--calendar-event);
  border: 1px solid var(--line);
}

.legend-dot.emergency {
  background: var(--warning);
}

.calendar-event-actions {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}

.calendar-event-actions .secondary-button,
.calendar-event-actions .primary-button {
  min-width: 180px;
  min-height: 48px;
}

.row-heading.history-list-heading {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.history-list-heading form {
  margin: 0;
}

.history-list-heading .secondary-button {
  min-height: 44px;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 18px;
}

.history-swipe {
  --history-action-width: 84px;
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: transparent;
  touch-action: pan-y;
}

.history-action {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--history-action-width);
  display: grid;
  place-items: center;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
  background: var(--danger);
  opacity: 0;
  pointer-events: none;
}

.history-swipe.is-open .history-action {
  opacity: 1;
  pointer-events: auto;
}

.history-swipe.is-open .history-item {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.history-action button {
  color: #fff;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.history-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
  min-height: 112px;
  padding: 22px 24px;
  background: var(--history-item-bg);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  color: var(--text);
  box-shadow:
    var(--history-item-shadow),
    var(--history-item-highlight);
  transition: transform 0.2s ease;
}

.history-item.deleted {
  color: var(--deleted-text);
  background:
    repeating-linear-gradient(
      -45deg,
      var(--history-deleted-stripe) 0 5px,
      rgba(255, 255, 255, 0) 5px 15px
    ),
    var(--history-deleted-bg);
}

.history-item em {
  color: var(--text);
  font-style: normal;
  font-size: 20px;
  font-weight: 700;
}

.history-time {
  display: inline-flex;
  align-items: center;
  gap: 28px;
}

.history-status.normal {
  color: var(--primary);
}

.history-status.emergency {
  color: var(--warning);
}

.seal-view {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 20px;
}

.seal-view img {
  max-width: min(460px, 100%);
  max-height: 360px;
  border-radius: var(--card-radius);
  border: 1px solid var(--line);
}

.large-number {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

@media (max-width: 640px) {
  .history-overview {
    --history-stat-value-size: 24px;
  }

  .topbar,
  .row-heading,
  .active-toolbar {
    align-items: flex-start;
  }

  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    align-items: center;
    padding:
      6px
      6px
      6px
      16px;
    width: min(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), 1040px);
  }

  .brand {
    max-width: 100%;
    font-size: 17px;
  }

  .row-heading {
    flex-wrap: wrap;
  }

  .bottom-nav {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: min(330px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }

  .page {
    width: min(100% - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), 1040px);
    margin-top: 14px;
    margin-bottom: 44px;
  }

  .workspace,
  .active-shell {
    padding: 16px;
  }

  .workspace.compact {
    padding: 16px;
  }

  .history-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .history-stat-card {
    min-height: 88px;
    padding: 14px;
  }

  .calendar-panel {
    gap: 12px;
  }

  .calendar-frame {
    padding: 12px;
    gap: 12px;
  }

  .calendar-heading {
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    min-height: 54px;
    margin-bottom: 12px;
    padding: 7px 9px;
  }

  .calendar-month-button {
    width: 44px;
    height: 38px;
    font-size: 22px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 6px 0;
  }

  .calendar-weekdays span {
    font-size: 13px;
  }

  .calendar-day {
    min-height: 38px;
    padding: 0;
    font-size: 15px;
  }

  .calendar-session-fill {
    right: 2px;
    left: 2px;
  }

  .calendar-day.today::before {
    right: 2px;
    left: 2px;
  }

  .calendar-add-mode .calendar-day:not(.empty)::after {
    top: 3px;
    right: 4px;
    bottom: 3px;
    left: 4px;
    border-width: 1.5px;
  }

  .calendar-emergency-marker,
  .calendar-user-event-marker {
    left: 50%;
    bottom: 5px;
    width: 7px;
    height: 7px;
    border-width: 1.5px;
  }

  .calendar-legend {
    gap: 8px 12px;
    font-size: 13px;
  }

  .calendar-event-actions {
    padding-top: 14px;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 96px;
    padding: 18px 20px;
  }

  .history-time {
    gap: 20px;
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .time-card {
    min-height: 88px;
    padding: 12px 6px;
    border-radius: var(--card-radius);
  }

  .time-card strong {
    font-size: clamp(30px, 10vw, 46px);
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .profile-actions,
  .backup-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) and (orientation: landscape) {
  .history-overview {
    --history-stat-value-size: 20px;
  }

  .history-stats {
    gap: 10px;
  }

  .history-stat-card {
    min-height: 78px;
    padding: 12px;
  }

  .history-stat-card span {
    font-size: 13px;
    line-height: 1.2;
  }
}

@media (max-width: 520px) {
  .history-overview {
    --history-stat-value-size: 22px;
  }
}

@media (max-width: 380px) {
  .history-overview {
    --history-stat-value-size: 20px;
  }
}

.wheel-config {
  display: grid;
  gap: 22px;
}

.wheel-cooldown-block,
.wheel-segment-row {
  display: grid;
  gap: 14px;
}

.wheel-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.wheel-mode-row label {
  position: relative;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
}

.wheel-mode-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wheel-mode-row label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.cooldown-minutes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-weight: 400;
}

.cooldown-duration {
  margin-bottom: 0;
}

.cooldown-duration label,
.cooldown-duration input[type="number"] {
  font-weight: 400;
}

.wheel-segments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.segment-count-control {
  display: grid;
  grid-template-columns: 48px minmax(72px, 1fr) 48px;
  align-items: center;
  gap: 10px;
  min-width: 188px;
}

.segment-count-control button,
.segment-count-control input {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 900;
}

.segment-count-control input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.segment-count-control input::-webkit-inner-spin-button,
.segment-count-control input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.wheel-segments {
  display: grid;
  gap: 16px;
}

.wheel-segment-row {
  padding: 20px;
  border: 1px solid #c6ced6;
  border-radius: var(--card-radius);
  background: #f7f9fa;
  box-shadow: 0 3px 10px rgba(32, 36, 42, 0.04);
}

.wheel-segment-row select,
.wheel-segment-text {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--surface);
  font-weight: 700;
}

.wheel-freeze-warning {
  margin: 0;
  color: var(--warning);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.paused-mode .pulse-dot {
  background: var(--frozen);
  box-shadow: 0 0 0 8px rgba(234, 255, 104, 0.14);
}

.paused-mode .running-status {
  color: var(--text);
}

.paused-mode .time-card {
  border-color: var(--frozen-line);
  background: var(--frozen-soft);
}

.paused-mode .time-card span {
  color: var(--text);
}

.paused-mode .progress-fill {
  stroke: #D6F238;
}

.paused-mode .progress-ring-track {
  stroke: url("#frozen-progress-track-gradient");
  filter: drop-shadow(0 0 4px rgba(184, 196, 72, 0.07));
}

.active-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 4px auto 12px;
}

.active-action-button {
  min-width: 160px;
}

.wheel-workspace {
  display: grid;
  gap: 28px;
}

.compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wheel-panel {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 20px;
  margin: 0 auto;
}

.standalone-wheel-panel {
  position: relative;
  padding: 28px 20px 34px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.wheel-pointer {
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--primary-dark);
  margin-bottom: -8px;
  position: relative;
  z-index: 2;
}

.wheel-disc {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  display: block;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(32, 36, 42, 0.12);
  transform-origin: center;
  transition: transform 900ms cubic-bezier(0.16, 0.82, 0.28, 1);
  overflow: visible;
}

.wheel-disc path {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.35;
}

.wheel-disc text {
  font-size: 5px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.wheel-center {
  fill: #fff;
  stroke: var(--line);
  stroke-width: 0.65;
}

.wheel-status,
.wheel-result {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.wheel-result {
  color: var(--primary);
}

.wheel-spin-button {
  width: min(260px, 100%);
}

@media (max-width: 720px) {
  .wheel-segments-header,
  .cooldown-minutes {
    align-items: stretch;
    flex-direction: column;
  }

  .segment-count-control {
    width: 100%;
  }
}

/* Shadow-led boundary system */
.bottom-nav,
.profile-username,
.profile-module,
.workspace,
.active-shell,
.login-panel,
.create-card,
.management-section,
.modal,
.history-stat-card,
.calendar-frame,
.history-item,
.standalone-wheel-panel {
  border-color: transparent;
  box-shadow: var(--shadow);
}

.segmented label,
.radio-grid label,
.tick-row,
.switch-row,
.number-seal input,
.photo-preview,
.icon-button,
.display-menu,
.time-card,
.calendar-heading,
.seal-view img,
.wheel-segment-row,
.calendar-month-button,
.segment-count-control button {
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

input[type="text"],
input[type="password"],
input[type="number"],
.profile-form input:not([type]),
.profile-form input[type="text"],
.profile-form input[type="password"],
.login-panel input:not([type]),
.login-panel input[type="text"],
.login-panel input[type="password"],
.secondary-button,
.secondary-button.profile-edit-button,
.warning-button,
.display-menu button,
.display-menu button.selected,
.display-options button,
.segment-count-control input,
.wheel-segment-row select,
.wheel-segment-text {
  border-color: transparent;
  box-shadow: var(--shadow-control);
}

.form-section,
.detail-list div {
  border-color: transparent;
}

.progress-capsule {
  border-color: transparent;
  border-style: solid;
  box-shadow: var(--shadow-control);
}

.photo-dropzone {
  border-color: transparent;
  box-shadow: var(--shadow-inset);
}

.photo-dropzone:hover {
  border-color: transparent;
  background: var(--surface-soft);
  box-shadow: var(--shadow-inset);
}

.seal-choice-row label:has(input:checked),
.wheel-mode-row label:has(input:checked),
.progress-capsule:has(input:checked),
.display-options button.selected {
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(105, 90, 178, 0.26);
}

.danger-zone {
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(184, 64, 64, 0.2);
}

.delete-slider {
  border-color: transparent;
  box-shadow:
    inset 0 3px 9px rgba(184, 64, 64, 0.2),
    inset 0 -2px 6px rgba(255, 255, 255, 0.62);
}

.primary-button,
.primary-link,
.bottom-nav a.selected {
  box-shadow: var(--shadow-control);
}

.seal-create-card .number-seal [data-reshuffle] {
  color: var(--bright-action-text) !important;
  -webkit-text-fill-color: var(--bright-action-text) !important;
}

.create-lite-card.seal-create-card .number-seal .secondary-button[data-reshuffle] {
  color: var(--bright-action-text) !important;
  -webkit-text-fill-color: var(--bright-action-text) !important;
}

.danger-button {
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(184, 64, 64, 0.22);
}

.paused-mode .time-card {
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(234, 255, 104, 0.38);
}

.calendar-add-mode .calendar-day:not(.empty)::after {
  border: 0;
  box-shadow: 0 0 0 3px rgba(248, 252, 218, 0.95);
}

.calendar-emergency-marker,
.calendar-user-event-marker,
.legend-dot.user-event {
  border-color: transparent;
}

.history-swipe {
  box-shadow:
    0 12px 26px rgba(105, 90, 178, 0.16),
    0 4px 10px rgba(23, 34, 75, 0.08);
}

.history-swipe:has(.history-item.deleted) {
  box-shadow:
    0 11px 24px rgba(122, 127, 140, 0.22),
    0 4px 9px rgba(23, 34, 75, 0.08);
}

.history-item {
  box-shadow:
    var(--history-item-shadow),
    var(--history-item-highlight);
}

.history-item.deleted {
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.16),
    var(--history-item-highlight);
}

.calendar-user-event-marker,
.legend-dot.user-event {
  box-shadow:
    0 0 0 2px rgba(105, 90, 178, 0.22),
    0 3px 7px rgba(105, 90, 178, 0.26);
}

.wheel-center {
  stroke: none;
}

.wheel-disc path {
  stroke: none;
}

.seal-choice-row,
.wheel-mode-row {
  --selected-index: 0;
  position: relative;
  padding: 4px;
  border-radius: 999px;
  background: rgba(146, 132, 214, 0.1);
  box-shadow: var(--shadow-inset);
  isolation: isolate;
}

.seal-choice-row:has(label:nth-child(2) input:checked),
.wheel-mode-row:has(label:nth-child(2) input:checked) {
  --selected-index: 1;
}

.wheel-mode-row:has(label:nth-child(3) input:checked) {
  --selected-index: 2;
}

.seal-choice-row::before,
.wheel-mode-row::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 0;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow-control);
  transform: translateX(calc(var(--selected-index) * (100% + 12px)));
  transition: transform 180ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.seal-choice-row::before {
  width: calc((100% - 20px) / 2);
}

.wheel-mode-row::before {
  width: calc((100% - 32px) / 3);
}

.seal-choice-row label,
.wheel-mode-row label {
  position: relative;
  z-index: 1;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  box-shadow: none;
  transition: color 140ms ease, -webkit-text-fill-color 140ms ease;
}

.seal-choice-row label:has(input:checked),
.wheel-mode-row label:has(input:checked) {
  border-color: transparent;
  background: transparent;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: none;
}

.progress-capsule {
  gap: 8px;
}

.progress-capsule::before {
  content: "+";
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  background: rgba(146, 132, 214, 0.16);
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.progress-capsule:has(input:checked)::before {
  content: "✓";
  background: var(--surface);
  color: var(--primary-dark);
}

input[type="text"],
input[type="password"],
input[type="number"],
.profile-form input:not([type]),
.profile-form input[type="text"],
.profile-form input[type="password"],
.login-panel input:not([type]),
.login-panel input[type="text"],
.login-panel input[type="password"],
.segment-count-control input,
.wheel-segment-text {
  box-shadow: var(--shadow-input);
}

.ios-switch input:focus-visible + span,
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(146, 132, 214, 0.3), var(--shadow-control);
}

input:focus-visible {
  box-shadow: 0 0 0 4px rgba(146, 132, 214, 0.3), var(--shadow-input);
}

.delete-slider button,
.delete-slider button:focus-visible {
  box-shadow:
    0 7px 12px rgba(184, 64, 64, 0.28),
    0 3px 5px rgba(105, 90, 178, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -2px 4px rgba(113, 35, 35, 0.16);
}

.hold-button,
.hold-button:focus-visible {
  box-shadow:
    0 9px 18px rgba(224, 173, 0, 0.24),
    0 4px 8px rgba(105, 90, 178, 0.12),
    inset 0 3px 0 rgba(255, 255, 255, 0.72),
    inset 0 -3px 7px rgba(224, 173, 0, 0.14);
}

.segment-count-control input {
  box-shadow: var(--shadow-control);
}

.wheel-segment-row select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 52px;
  background-color: var(--surface);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 23px) 50%,
    calc(100% - 17px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-input);
}

.wheel-segment-row select option {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.create-workspace .field-label,
.create-workspace .help-text,
.create-workspace .cooldown-minutes {
  color: var(--text);
}

.create-workspace .section-heading p {
  color: var(--muted);
}

.display-options {
  box-shadow: var(--shadow-inset);
}

.display-options button {
  background-color: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  box-shadow: none;
}

.display-options button.selected {
  background-color: transparent;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav::before,
  .display-options::before,
  .seal-choice-row::before,
  .wheel-mode-row::before,
  .bottom-nav a,
  .display-options button,
  .seal-choice-row label,
  .wheel-mode-row label {
    transition: none;
  }
}

.bottom-nav a.selected {
  background: transparent;
  box-shadow: none;
}

.create-lite-form {
  gap: 18px;
}

.create-wizard-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr) 10px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: var(--wizard-bg);
  box-shadow: var(--wizard-shadow);
}

.create-wizard-stepper button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-weight: 700;
  box-shadow: none;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 140ms ease, opacity 140ms ease;
}

.create-wizard-stepper button.selected {
  background: var(--primary);
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow:
    0 8px 18px rgba(105, 90, 178, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.create-wizard-stepper.is-advancing button.selected {
  animation: wizard-selected-pop 420ms ease;
}

.create-wizard-stepper.is-advancing span {
  animation: wizard-arrow-glow 420ms ease;
}

@keyframes wizard-selected-pop {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 8px 18px rgba(105, 90, 178, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  45% {
    transform: scale(1.025);
    box-shadow:
      0 12px 24px rgba(105, 90, 178, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

@keyframes wizard-arrow-glow {
  0%,
  100% {
    color: var(--wizard-muted);
  }
  45% {
    color: var(--muted);
  }
}

.create-wizard-stepper button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--wizard-disabled);
  -webkit-text-fill-color: var(--wizard-disabled);
}

.create-wizard-stepper span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wizard-muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transform: none;
}

.create-wizard-page.hidden {
  display: none;
}

.create-lite-card {
  gap: 20px;
  padding: clamp(22px, 5vw, 34px);
}

.create-lite-card .form-section {
  border-top: 0;
  padding-top: 0;
}

.create-lite-card .form-section + .form-section {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 0;
}

.create-lite-card .section-heading {
  gap: 10px;
}

.create-lite-card .section-heading h1 {
  margin-bottom: 0;
}

.create-lite-card h2 {
  color: var(--text);
}

.create-lite-card .row-heading {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-bottom: 14px;
}

.create-lite-card .row-heading h2 {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  line-height: 1;
}

.lite-switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  line-height: 1;
  transform: translateY(-2px);
}

.create-lite-card .duration-row {
  width: 100%;
  max-width: none;
}

.create-lite-card .display-options,
.create-lite-card .wheel-mode-row,
.create-lite-card .seal-choice-row {
  width: 100%;
}

.create-lite-card .switch-row {
  margin-top: 16px;
  margin-bottom: 0;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-control);
}

.create-lite-card .create-display-lock-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.create-display-heading .create-display-lock-row {
  margin-top: 0;
  padding: 0;
}

.create-lite-card .wheel-config {
  display: grid;
  gap: 22px;
  margin-top: 16px;
  margin-bottom: 10px;
}

.create-lite-card .wheel-config.hidden {
  display: none;
}

.temporary-unlock-config {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.temporary-unlock-config.hidden,
.temporary-penalty-config.hidden {
  display: none;
}

.temporary-duration-block {
  display: grid;
  gap: 8px;
}

.temporary-duration-block .field-label {
  margin: 0;
}

.temporary-duration-primary {
  padding: 18px;
  border-radius: var(--card-radius);
  background: rgba(146, 132, 214, 0.08);
  box-shadow: var(--shadow-inset);
}

.temporary-duration-primary .field-label {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.temporary-duration-primary .duration-row {
  margin-bottom: 0;
}

.temporary-duration-primary input[type="number"] {
  height: 58px;
  font-size: 1.2rem;
  font-weight: 800;
}

.temporary-penalty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
}

.temporary-penalty-row .field-label {
  margin: 0;
}

.extension-card {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 8px 18px 18px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-control);
}

.extension-card .row-heading {
  min-height: 40px;
  margin-bottom: 0;
}

.extension-card:has(.wheel-config.hidden),
.extension-card:has(.temporary-unlock-config.hidden) {
  padding: 8px 18px;
}

.extension-card:has(.wheel-config.hidden) .row-heading,
.extension-card:has(.temporary-unlock-config.hidden) .row-heading {
  min-height: 40px;
}

.create-lite-card .wheel-segment-row {
  border: 0;
  background: var(--extension-row-bg);
  box-shadow: var(--shadow-control);
}

.create-lite-card .wheel-cooldown-block {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.create-lite-card .wheel-segments-header {
  display: grid;
  justify-content: stretch;
  align-items: start;
  gap: 12px;
  margin-top: 2px;
}

.create-lite-card .segment-count-control {
  grid-template-columns: 54px minmax(0, 1fr) 54px;
}

.create-lite-card .segment-count-control button,
.create-lite-card .segment-count-control input {
  min-height: 54px;
}

.create-lite-card .number-seal input,
.create-lite-card .number-seal .secondary-button,
.create-lite-card.seal-create-card > .wide-button {
  width: 100%;
}

.create-lite-card.seal-create-card > .wide-button {
  margin-top: 4px;
}

.create-review-icons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.review-icon-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: clamp(10px, 2.75vw, 13px);
  font-weight: 500;
  line-height: 1.18;
  text-align: center;
  white-space: nowrap;
}

.review-icon-card > span:not(.review-icon-symbol) {
  white-space: pre-line;
}

.review-icon-symbol {
  width: clamp(40px, 11vw, 54px);
  height: clamp(40px, 11vw, 54px);
  color: var(--deep-primary);
  background: currentColor;
  filter: drop-shadow(0 10px 18px rgba(105, 90, 178, 0.18));
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.review-icon-symbol.timer {
  -webkit-mask-image: url("/static/icons/review-timer.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-timer.svg?v=lite-fork-39");
}

.review-icon-symbol.progress {
  -webkit-mask-image: url("/static/icons/review-progress.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-progress.svg?v=lite-fork-39");
}

.review-icon-symbol.eye-close {
  -webkit-mask-image: url("/static/icons/review-eye-close.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-eye-close.svg?v=lite-fork-39");
}

.review-icon-symbol.lock {
  -webkit-mask-image: url("/static/icons/review-lock.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-lock.svg?v=lite-fork-39");
}

.review-icon-symbol.lucky-wheel {
  -webkit-mask-image: url("/static/icons/review-lucky-wheel.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-lucky-wheel.svg?v=lite-fork-39");
}

.review-icon-symbol.extension-off {
  -webkit-mask-image: url("/static/icons/review-extension-off.svg?v=lite-fork-39");
  mask-image: url("/static/icons/review-extension-off.svg?v=lite-fork-39");
}

.number-seal input.is-shuffling {
  animation: seal-number-shuffle 1s ease;
}

@keyframes seal-number-shuffle {
  0%,
  100% {
    background: var(--surface-soft);
    box-shadow: var(--shadow-control);
    transform: scale(1);
  }
  45%,
  65% {
    background: var(--frozen-soft);
    box-shadow: 0 14px 30px rgba(234, 255, 104, 0.36), 0 6px 16px rgba(105, 90, 178, 0.16);
    transform: scale(1.012);
  }
}

.review-section-card {
  padding: 28px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-control);
}

.create-lite-card .review-section-card {
  padding: 28px;
}

.review-section-card h2 {
  margin-bottom: 18px;
}

.wizard-actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.wizard-actions.two-column {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.extension-actions {
  width: min(100%, 560px);
  margin: 34px auto 0;
}

@media (max-width: 620px) {
  .create-lite-card {
    padding: 22px;
  }

  .create-lite-card .row-heading {
    gap: 12px;
    align-items: center;
    grid-template-columns: minmax(0, auto) auto;
  }

  .lite-switch-control {
    gap: 8px;
  }

  .create-wizard-stepper {
    grid-template-columns: minmax(0, 1fr) 8px minmax(0, 1fr) 8px minmax(0, 1fr);
    gap: 4px;
    padding: 5px;
  }

  .create-wizard-stepper button {
    min-height: 38px;
    font-size: 14px;
  }

  .create-wizard-stepper span {
    font-size: 13px;
  }

  .wizard-actions.two-column {
    grid-template-columns: 1fr;
  }

  .extension-actions {
    width: 100%;
    margin-top: 32px;
  }
}
