:root {
  color-scheme: light dark;
  --font-main: "Manrope", "SF Pro Display", "Avenir Next", "Helvetica Neue", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --viewport-height: 100dvh;

  --tg-bg: #f5f7fc;
  --tg-secondary-bg: #eef3fb;
  --tg-text: #141824;
  --tg-hint: #6b7283;
  --tg-button: #0a84ff;
  --tg-button-text: #ffffff;

  --bg-top: #f8f9ff;
  --bg-bottom: #e9eefc;
  --surface: rgba(255, 255, 255, 0.56);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --card-bg: linear-gradient(148deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34));
  --card-bg-soft: linear-gradient(148deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.26));
  --card-stroke: rgba(255, 255, 255, 0.52);
  --card-shine: rgba(255, 255, 255, 0.5);
  --text-primary: #141824;
  --text-secondary: #5f6678;
  --text-tertiary: #7f889d;
  --accent: #207dff;
  --accent-soft: rgba(32, 125, 255, 0.18);
  --mint: #18c3a0;
  --violet: #6b74ff;
  --border-subtle: rgba(255, 255, 255, 0.46);
  --line-soft: rgba(16, 24, 40, 0.08);
  --shadow-card: 0 8px 20px rgba(25, 39, 90, 0.12);
  --shadow-soft: 0 6px 14px rgba(16, 24, 54, 0.1);
  --shine: rgba(255, 255, 255, 0.42);
  --ease-out-premium: cubic-bezier(0.18, 0.76, 0.24, 1);
  --ease-snap: cubic-bezier(0.28, 0.84, 0.42, 1);
  --motion-fast: 0.18s;
  --motion-mid: 0.28s;
}

body[data-theme="dark"] {
  --bg-top: #0d1322;
  --bg-bottom: #10182a;
  --surface: rgba(20, 31, 51, 0.58);
  --surface-strong: rgba(22, 35, 58, 0.78);
  --card-bg: linear-gradient(148deg, rgba(33, 49, 78, 0.86), rgba(22, 34, 56, 0.74));
  --card-bg-soft: linear-gradient(148deg, rgba(30, 46, 73, 0.76), rgba(21, 33, 53, 0.64));
  --card-stroke: rgba(255, 255, 255, 0.14);
  --card-shine: rgba(255, 255, 255, 0.12);
  --text-primary: #f6f8ff;
  --text-secondary: #bdc6da;
  --text-tertiary: #8d97ae;
  --accent-soft: rgba(94, 181, 255, 0.25);
  --mint: #44d8b4;
  --border-subtle: rgba(255, 255, 255, 0.11);
  --line-soft: rgba(255, 255, 255, 0.12);
  --shadow-card: 0 16px 38px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 20px rgba(0, 0, 0, 0.3);
  --shine: rgba(255, 255, 255, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: var(--viewport-height);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.35;
  background:
    radial-gradient(900px 460px at 82% -12%, rgba(107, 116, 255, 0.24), transparent 58%),
    radial-gradient(700px 420px at -12% 15%, rgba(24, 195, 160, 0.20), transparent 60%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

.file-input-proxy {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

button {
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"] {
  touch-action: manipulation;
}

.background-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.45;
  animation: float-orb 16s ease-in-out infinite;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 30% 30%, rgba(32, 125, 255, 0.50), rgba(32, 125, 255, 0));
  top: -50px;
  left: -70px;
  animation-delay: -2s;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at 60% 40%, rgba(24, 195, 160, 0.32), rgba(24, 195, 160, 0));
  top: 35%;
  right: -90px;
  animation-delay: -8s;
}

.orb-c {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 50% 50%, rgba(107, 116, 255, 0.24), rgba(107, 116, 255, 0));
  bottom: -40px;
  left: 25%;
  animation-delay: -12s;
}

@keyframes float-orb {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  min-height: var(--viewport-height);
  margin: 0 auto;
  padding:
    calc(14px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(110px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.glass-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--card-stroke);
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(19, 31, 58, 0.12);
  overflow: hidden;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-shine), transparent);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card,
  .bottom-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--card-bg);
  }
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24)),
    linear-gradient(120deg, rgba(32, 125, 255, 0.16), rgba(24, 195, 160, 0.11));
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.avatar-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background:
    linear-gradient(145deg, rgba(32, 125, 255, 0.25), rgba(24, 195, 160, 0.20)),
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.45), transparent 58%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 8px 18px rgba(32, 125, 255, 0.2);
}

.avatar-badge.avatar-logo {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 8px 18px rgba(34, 43, 72, 0.15);
}

.avatar-badge.avatar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-line {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.header-copy h1 {
  margin: 0;
  font-size: clamp(24px, 5.8vw, 29px);
  line-height: 1.1;
  font-weight: 820;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.header-copy p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.header-copy {
  min-width: 0;
}

.sync-chip {
  margin: 7px 0 0;
  min-height: 20px;
  max-width: 100%;
  width: fit-content;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.sync-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  z-index: 2;
}

.sync-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.45) 50%, transparent 68%);
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

.sync-chip.is-loading {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.36);
}

.sync-chip.is-loading::before {
  animation: chip-dot-pulse 1.2s ease-in-out infinite;
}

.sync-chip.is-loading::after {
  opacity: 0.85;
  animation: chip-shimmer 1.8s linear infinite;
}

.sync-chip.is-ready {
  color: #0f8f71;
  border-color: rgba(15, 143, 113, 0.3);
  background: rgba(68, 216, 180, 0.16);
}

.sync-chip.is-error {
  color: #a41f35;
  border-color: rgba(244, 64, 94, 0.34);
  background: rgba(244, 64, 94, 0.14);
}

.sync-chip.is-demo {
  color: #6d7386;
  background: rgba(255, 255, 255, 0.28);
}

.header-pill {
  display: none;
}

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.26));
  color: var(--text-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--motion-fast) var(--ease-snap),
    background-color var(--motion-mid) ease,
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease;
  box-shadow: 0 10px 22px rgba(20, 26, 56, 0.14);
}

.icon-button.is-active {
  color: #0d926f;
  border-color: rgba(13, 146, 111, 0.34);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)),
    linear-gradient(150deg, rgba(125, 242, 208, 0.42), rgba(255, 255, 255, 0.35));
  box-shadow: 0 12px 24px rgba(24, 195, 160, 0.24);
}

.icon-button:disabled {
  opacity: 0.74;
  cursor: default;
  pointer-events: none;
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(32, 125, 255, 0.3);
  box-shadow: 0 12px 24px rgba(20, 26, 56, 0.2);
}

.icon-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2), 0 12px 24px rgba(20, 26, 56, 0.2);
}

.icon-svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transform-origin: 50% 20%;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.icon-button:hover .icon-svg,
.icon-button:focus-visible .icon-svg {
  transform: translateY(-1px) scale(1.04);
}

.icon-button:active .icon-svg {
  transform: scale(0.92);
}

.icon-button.is-active .icon-svg {
  animation: bell-ring 1.9s ease-in-out infinite;
}

:where(.btn, .list-item, .tab-btn, .preset-btn, .icon-button, .priority-card, .setting-row) {
  position: relative;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

:where(.btn, .list-item, .tab-btn, .preset-btn, .icon-button, .priority-card, .setting-row)[data-pressed="1"] {
  transform: translateY(1px) scale(0.982) !important;
}

.tap-ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  animation: tap-ripple 0.52s var(--ease-out-premium) forwards;
}

.tab-container {
  margin-top: 14px;
}

.tab-screen {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-screen.is-active {
  display: flex;
  animation: tab-enter 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes tab-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card {
  padding: 18px;
  background:
    linear-gradient(138deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24)),
    radial-gradient(420px 180px at 88% 2%, rgba(32, 125, 255, 0.2), transparent 72%);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

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

.eyebrow {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.hero-card h2,
.feature-hero h2,
.profile-block h2 {
  margin: 4px 0 0;
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hero-subline {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.hero-chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chip {
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.26);
  min-height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
}

.hero-chip-positive {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(130deg, var(--mint), #38b99b);
  box-shadow: 0 8px 14px rgba(24, 195, 160, 0.3);
}

.hero-chip-neutral {
  background: rgba(255, 255, 255, 0.34);
  color: var(--text-primary);
}

.hero-chip-neutral.is-good {
  color: #0f8f71;
  border-color: rgba(15, 143, 113, 0.28);
  background: rgba(68, 216, 180, 0.18);
}

.hero-chip-neutral.is-warn {
  color: #a35d00;
  border-color: rgba(250, 172, 20, 0.34);
  background: rgba(250, 172, 20, 0.18);
}

.hero-chip-neutral.is-danger {
  color: #a41f35;
  border-color: rgba(244, 64, 94, 0.34);
  background: rgba(244, 64, 94, 0.14);
}

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

.hero-stat {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.3);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-stat span {
  font-size: 11px;
  color: var(--text-secondary);
}

.hero-stat strong {
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.ring {
  --size: 78px;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(
      from -30deg,
      var(--accent) calc(var(--progress, 0) * 1%),
      rgba(255, 255, 255, 0.22) 0%
    );
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36), 0 10px 22px rgba(32, 125, 255, 0.2);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--surface-strong);
  border: 1px solid var(--border-subtle);
}

.ring span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
}

.ring.is-warn {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36), 0 10px 22px rgba(250, 172, 20, 0.24);
}

.ring.is-danger {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36), 0 10px 22px rgba(244, 64, 94, 0.24);
}

.progress-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.progress-head span,
.progress-head strong {
  min-width: 0;
}

.progress-head span {
  font-size: 14px;
  color: var(--text-secondary);
}

.progress-head strong {
  font-size: 14px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 141, 170, 0.24);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: min(100%, var(--fill, 0%));
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), #45b2ff);
  box-shadow: 0 0 12px rgba(69, 178, 255, 0.5);
}

.progress-fill.is-warn {
  background: linear-gradient(120deg, #f7b833, #ff9f43);
  box-shadow: 0 0 12px rgba(255, 172, 51, 0.45);
}

.progress-fill.is-danger {
  background: linear-gradient(120deg, #ff4f70, #ff7d63);
  box-shadow: 0 0 12px rgba(255, 94, 119, 0.45);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.btn {
  position: relative;
  isolation: isolate;
  border-radius: 22px;
  border: 1px solid transparent;
  min-height: 86px;
  padding: 13px 14px;
  font-weight: 760;
  font-size: 15px;
  line-height: 1.24;
  letter-spacing: 0.004em;
  cursor: pointer;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  overflow: hidden;
  transition:
    transform var(--motion-fast) var(--ease-snap),
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease,
    background var(--motion-mid) ease,
    opacity var(--motion-fast) ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  opacity: 0.52;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.62;
}

.btn-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.btn-copy strong {
  display: block;
  font-size: 17px;
  line-height: 1.14;
  letter-spacing: -0.01em;
  font-weight: 790;
  overflow-wrap: anywhere;
}

.btn-copy small {
  display: block;
  font-size: 12px;
  line-height: 1.26;
  color: var(--text-secondary);
  opacity: 0.98;
  overflow-wrap: anywhere;
}

.btn-primary {
  color: var(--tg-button-text);
  border-color: rgba(255, 255, 255, 0.26);
  background:
    radial-gradient(126px 80px at 100% -6%, rgba(255, 255, 255, 0.34), transparent 75%),
    linear-gradient(138deg, #0b84ff 0%, #3f97ff 54%, #64a8ff 100%);
  box-shadow: 0 12px 24px rgba(18, 74, 163, 0.3), 0 4px 10px rgba(12, 47, 106, 0.18);
}

.btn-secondary {
  color: var(--text-primary);
  border-color: rgba(127, 141, 170, 0.24);
  background:
    radial-gradient(124px 76px at 100% -12%, rgba(32, 125, 255, 0.12), transparent 74%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.4));
  box-shadow: 0 10px 20px rgba(19, 31, 62, 0.1);
}

.btn-primary .btn-copy small {
  color: rgba(255, 255, 255, 0.9);
}

.btn-glyph {
  position: relative;
  z-index: 1;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  opacity: 1;
  flex-shrink: 0;
  transition: transform 0.22s ease, opacity 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary .btn-glyph {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 5px 12px rgba(20, 57, 119, 0.24);
}

.btn-secondary .btn-glyph {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 9px rgba(17, 26, 52, 0.13);
}

.btn-icon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover .btn-glyph,
.btn:focus-visible .btn-glyph {
  transform: translateY(-1px) scale(1.06);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px) scale(1.004);
  box-shadow: 0 16px 28px rgba(18, 31, 60, 0.2);
}

.btn:hover::before,
.btn:focus-visible::before {
  opacity: 0.72;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.22), 0 16px 28px rgba(18, 31, 60, 0.2);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:active .btn-glyph {
  transform: scale(0.9);
}

.btn:disabled {
  opacity: 0.62;
  pointer-events: none;
}

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

.panel h3 {
  margin: 2px 2px 0;
  font-size: 13px;
  font-weight: 730;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-tertiary);
}

.trend-card {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.3)),
    radial-gradient(220px 90px at 100% -20%, rgba(32, 125, 255, 0.12), transparent 74%);
  box-shadow: 0 14px 28px rgba(20, 30, 56, 0.11);
  padding: 10px 10px 12px;
}

.trend-meta {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  margin: 0 2px 8px;
  overflow-wrap: anywhere;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  min-height: 146px;
  margin-bottom: 10px;
}

.trend-day {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.trend-value {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.trend-bar-track {
  position: relative;
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(127, 141, 170, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.08));
  overflow: hidden;
}

.trend-bar-fill {
  width: 100%;
  min-height: 6px;
  border-radius: 8px;
  background: linear-gradient(180deg, #62b3ff, #1f84ff);
  box-shadow: 0 4px 10px rgba(25, 115, 230, 0.26);
  transition: height 0.34s var(--ease-out-premium), background 0.2s ease;
}

.trend-bar-fill.is-empty {
  min-height: 0;
  box-shadow: none;
  opacity: 0.2;
}

.trend-bar-fill.is-over {
  background: linear-gradient(180deg, #ff8a6d, #ff6249);
  box-shadow: 0 4px 10px rgba(218, 79, 57, 0.24);
}

.trend-label {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.trend-day.is-today .trend-label,
.trend-day.is-today .trend-value {
  color: var(--accent);
}

.trend-day.is-today .trend-bar-track {
  border-color: rgba(32, 125, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(32, 125, 255, 0.14);
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trend-stat-card {
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(127, 141, 170, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(247, 250, 255, 0.52)),
    radial-gradient(120px 48px at 100% -12%, rgba(32, 125, 255, 0.1), transparent 76%);
  padding: 11px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.trend-stat-card.is-wide {
  grid-column: 1 / -1;
}

.trend-stat-label {
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trend-stat-value {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.trend-stat-note {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

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

.compact-stack {
  gap: 8px;
}

.compact-item {
  min-height: 58px;
  padding: 11px 13px;
}

.priority-card {
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  width: 100%;
  text-align: left;
  color: inherit;
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.54)),
    radial-gradient(260px 140px at 96% -6%, rgba(32, 125, 255, 0.22), transparent 74%),
    radial-gradient(220px 120px at -8% 105%, rgba(24, 195, 160, 0.16), transparent 76%);
  padding: 14px 14px 14px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  box-shadow: 0 14px 26px rgba(17, 31, 64, 0.16);
  transition:
    transform var(--motion-fast) var(--ease-snap),
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease,
    background var(--motion-mid) ease;
}

.priority-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  opacity: 0.75;
  transition: opacity var(--motion-mid) ease;
}

.priority-card:hover,
.priority-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(32, 125, 255, 0.28);
  box-shadow: 0 18px 30px rgba(17, 31, 64, 0.2);
}

.priority-card:hover::before,
.priority-card:focus-visible::before {
  opacity: 1;
}

.priority-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2), 0 18px 30px rgba(17, 31, 64, 0.2);
}

.priority-card:active {
  transform: translateY(0) scale(0.987);
}

.priority-icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  display: inline-grid;
  place-items: center;
  align-self: flex-start;
  color: #1b74ff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 244, 255, 0.66)),
    radial-gradient(80px 36px at 50% -8%, rgba(32, 125, 255, 0.28), transparent 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54), 0 8px 14px rgba(32, 125, 255, 0.18);
}

.priority-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.priority-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.priority-label {
  margin: 0;
  font-size: 10.5px;
  color: #1b74ff;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 760;
}

.priority-main strong {
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
  font-weight: 790;
}

.priority-main span {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.priority-cta {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  border: 1px solid rgba(127, 141, 170, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.56)),
    radial-gradient(90px 34px at 50% -16%, rgba(32, 125, 255, 0.17), transparent 82%);
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
  white-space: nowrap;
  align-self: center;
}

.priority-cta-arrow {
  font-size: 15px;
  line-height: 1;
  color: var(--accent);
  transform: translateX(0);
  transition: transform var(--motion-fast) var(--ease-snap);
}

.priority-card:hover .priority-cta-arrow,
.priority-card:focus-visible .priority-cta-arrow {
  transform: translateX(2px);
}

.list-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(127, 141, 170, 0.2);
  border-radius: 20px;
  width: 100%;
  text-align: left;
  color: inherit;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.42)),
    radial-gradient(180px 80px at 100% -10%, rgba(32, 125, 255, 0.1), transparent 76%);
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 16px rgba(18, 30, 58, 0.1);
  transition:
    transform var(--motion-fast) var(--ease-snap),
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease,
    background var(--motion-mid) ease;
}

.list-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(126deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.list-item::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.75;
  transition: opacity 0.22s ease, border-color 0.22s ease;
  pointer-events: none;
  z-index: 0;
}

.list-item:hover,
.list-item:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(32, 125, 255, 0.26);
  box-shadow: 0 14px 24px rgba(18, 30, 58, 0.16);
}

.list-item:hover::after,
.list-item:focus-visible::after {
  border-color: rgba(32, 125, 255, 0.2);
  opacity: 1;
}

.list-item:active {
  transform: translateY(0) scale(0.986);
  box-shadow: 0 7px 14px rgba(18, 30, 58, 0.1);
}

.list-item.compact-item {
  min-height: 60px;
  padding: 11px 12px;
  border-radius: 18px;
}

.list-item.compact-item strong {
  font-size: 15px;
  font-weight: 760;
}

.list-item > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
  padding-left: 0;
}

.list-item strong {
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.008em;
  display: block;
  line-height: 1.23;
  overflow-wrap: anywhere;
}

.list-item p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.34;
  letter-spacing: 0.001em;
  overflow-wrap: anywhere;
}

.recent-list {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.26)),
    radial-gradient(220px 90px at 100% -20%, rgba(32, 125, 255, 0.12), transparent 74%);
  box-shadow: 0 14px 28px rgba(20, 30, 56, 0.11);
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-empty {
  padding: 14px 14px 15px;
  border-radius: 16px;
  border: 1px dashed var(--line-soft);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.3));
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon subtitle";
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
}

.recent-empty-icon {
  grid-area: icon;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(32, 125, 255, 0.9), rgba(24, 195, 160, 0.82));
  box-shadow: 0 0 0 5px rgba(32, 125, 255, 0.14);
}

.recent-empty-title {
  grid-area: title;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.recent-empty-subtitle {
  grid-area: subtitle;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.recent-empty.is-unlinked {
  border-style: solid;
  border-color: rgba(248, 140, 60, 0.32);
  background: linear-gradient(145deg, rgba(248, 140, 60, 0.18), rgba(255, 255, 255, 0.32));
}

.recent-empty.is-unlinked .recent-empty-icon {
  background: linear-gradient(145deg, rgba(248, 140, 60, 0.95), rgba(255, 182, 99, 0.92));
  box-shadow: 0 0 0 5px rgba(248, 140, 60, 0.16);
}

.recent-row {
  position: relative;
  border-radius: 16px;
  padding: 12px 13px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.34)),
    radial-gradient(160px 70px at 100% -24%, rgba(32, 125, 255, 0.11), transparent 75%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 8px 18px rgba(18, 30, 58, 0.1);
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.recent-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(18, 30, 58, 0.13);
}

.recent-row:active {
  transform: translateY(0);
}

.recent-row.is-draft {
  border-color: rgba(250, 172, 20, 0.42);
  background:
    linear-gradient(145deg, rgba(250, 172, 20, 0.2), rgba(255, 255, 255, 0.4)),
    radial-gradient(160px 70px at 100% -24%, rgba(250, 172, 20, 0.18), transparent 75%);
}

.recent-row.is-draft::after {
  content: "Черновик";
  position: absolute;
  top: 8px;
  right: 10px;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(250, 172, 20, 0.42);
  background: rgba(250, 172, 20, 0.16);
  color: #9b5b00;
  font-size: 10px;
  font-weight: 760;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
}

.recent-row > div:first-child {
  min-width: 0;
  flex: 1;
}

.recent-title {
  font-size: 15px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

.recent-meta {
  margin-top: 0.5px;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.recent-meta-wrap {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.recent-badge {
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  font-weight: 730;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
}

.recent-kcal {
  font-size: 15px;
  font-weight: 790;
  color: var(--text-primary);
  line-height: 1.18;
  text-align: right;
  overflow-wrap: anywhere;
  letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.save-hint {
  margin: 2px 2px 0;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  color: transparent;
  transform: translateY(-4px);
  transition: max-height 0.2s ease, opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease;
}

.save-hint.is-visible {
  max-height: 150px;
  opacity: 1;
  padding: 9px 12px;
  border-color: rgba(250, 172, 20, 0.34);
  background: rgba(250, 172, 20, 0.12);
  color: #9b5b00;
  transform: translateY(0);
}

.settings-card {
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.32)),
    radial-gradient(260px 110px at 100% -8%, rgba(32, 125, 255, 0.12), transparent 74%);
  isolation: isolate;
  overflow: clip;
  box-shadow: 0 14px 26px rgba(18, 30, 58, 0.12);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.settings-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(32, 125, 255, 0.14);
  font-size: clamp(12px, 3.2vw, 13px);
  font-weight: 760;
  letter-spacing: 0.008em;
  color: var(--text-secondary);
  background:
    linear-gradient(148deg, rgba(32, 125, 255, 0.11), rgba(32, 125, 255, 0.03)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34));
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-summary::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #39b0ff);
  box-shadow: 0 0 0 4px rgba(32, 125, 255, 0.12);
  flex-shrink: 0;
}

.setting-row {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 13px 12px;
  min-height: 82px;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid rgba(127, 141, 170, 0.22);
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.38)),
    radial-gradient(150px 70px at 100% -12%, rgba(32, 125, 255, 0.09), transparent 76%);
  box-shadow: 0 8px 16px rgba(18, 30, 58, 0.09);
  transition:
    transform var(--motion-fast) var(--ease-snap),
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease,
    background-color var(--motion-mid) ease;
}

.setting-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(126deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  opacity: 0.64;
  z-index: 0;
  pointer-events: none;
  transition: opacity var(--motion-mid) ease;
}

.setting-row > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-row::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(127, 141, 170, 0.56);
  box-shadow: 0 0 0 4px rgba(127, 141, 170, 0.12);
  z-index: 1;
  transition: background-color var(--motion-mid) ease, box-shadow var(--motion-mid) ease;
}

.setting-row:hover {
  transform: translateY(-2px);
  border-color: rgba(32, 125, 255, 0.28);
  box-shadow: 0 14px 22px rgba(18, 30, 58, 0.15);
}

.setting-row:hover::after {
  opacity: 0.92;
}

.setting-row:active {
  transform: scale(0.988);
  box-shadow: 0 7px 14px rgba(18, 30, 58, 0.11);
}

.setting-row:focus-visible {
  outline: none;
  border-color: rgba(32, 125, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2), 0 12px 20px rgba(18, 30, 58, 0.14);
}

.setting-row strong {
  display: block;
  font-size: clamp(15px, 3.7vw, 16px);
  line-height: 1.22;
  letter-spacing: -0.008em;
  font-weight: 770;
  overflow-wrap: anywhere;
}

.setting-row p {
  margin: 0;
  font-size: 12px;
  line-height: 1.34;
  letter-spacing: 0.002em;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.setting-row.is-on {
  border-color: rgba(32, 125, 255, 0.34);
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.4)),
    radial-gradient(150px 70px at 100% -12%, rgba(32, 125, 255, 0.15), transparent 76%);
}

.setting-row.is-on::before {
  background: linear-gradient(145deg, var(--accent), #3ab4ff);
  box-shadow: 0 0 0 4px rgba(32, 125, 255, 0.2);
}

.setting-row.is-off::before {
  background: rgba(127, 141, 170, 0.62);
  box-shadow: 0 0 0 4px rgba(127, 141, 170, 0.12);
}

.input-card {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 14px 14px 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.3)),
    radial-gradient(220px 88px at 100% -12%, rgba(32, 125, 255, 0.1), transparent 74%);
  box-shadow: 0 14px 24px rgba(20, 30, 56, 0.11);
}

.input-card label {
  display: block;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.input-card input {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 24px;
  min-height: 56px;
  height: auto;
  line-height: 1.1;
  padding: 0 16px;
  font-weight: 790;
  text-align: right;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, transform 0.14s ease;
}

.input-card input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2), 0 10px 18px rgba(24, 86, 189, 0.16);
}

.input-card input:active {
  transform: scale(0.998);
}

.preset-card {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.3)),
    radial-gradient(220px 88px at 100% -12%, rgba(107, 116, 255, 0.11), transparent 74%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 24px rgba(20, 30, 56, 0.11);
}

.preset-head strong {
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.012em;
}

.preset-head p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.preset-segmented {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.24)),
    radial-gradient(130px 54px at 50% -30%, rgba(32, 125, 255, 0.1), transparent 76%);
  padding: 4px;
  gap: 5px;
}

.preset-btn {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  height: auto;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 740;
  letter-spacing: 0.004em;
  padding: 9px 10px;
  overflow: hidden;
  transition:
    background-color var(--motion-mid) ease,
    color var(--motion-mid) ease,
    transform var(--motion-fast) var(--ease-snap),
    box-shadow var(--motion-mid) ease,
    border-color var(--motion-mid) ease;
}

.preset-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
}

.preset-btn:active {
  transform: scale(0.97);
}

.preset-btn.is-active {
  color: var(--text-primary);
  background:
    linear-gradient(130deg, var(--accent-soft), rgba(255, 255, 255, 0.5)),
    radial-gradient(90px 40px at 50% -20%, rgba(255, 255, 255, 0.5), transparent 84%);
  box-shadow: 0 8px 14px rgba(32, 125, 255, 0.16);
}

.preset-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2);
}

.feature-hero {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(127, 141, 170, 0.22);
  background:
    linear-gradient(146deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42)),
    radial-gradient(280px 128px at 100% -8%, rgba(107, 116, 255, 0.26), transparent 74%),
    radial-gradient(180px 90px at -8% 110%, rgba(24, 195, 160, 0.17), transparent 76%);
  box-shadow: 0 14px 26px rgba(18, 30, 58, 0.14);
  display: grid;
  gap: 11px;
}

.feature-hero-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.feature-hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  display: inline-grid;
  place-items: center;
  color: #4d68ff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(236, 240, 255, 0.72)),
    radial-gradient(90px 36px at 50% -10%, rgba(107, 116, 255, 0.26), transparent 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 14px rgba(56, 66, 142, 0.16);
}

.feature-hero-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-hero-copy {
  min-width: 0;
}

.feature-hero-copy .eyebrow {
  color: #5667df;
}

.feature-hero > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.feature-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feature-hero-chip {
  border-radius: 999px;
  border: 1px solid rgba(127, 141, 170, 0.22);
  min-height: 27px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 730;
  color: var(--text-secondary);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46)),
    radial-gradient(90px 34px at 50% -20%, rgba(32, 125, 255, 0.12), transparent 80%);
}

.feature-hero-chip.is-accent {
  color: #125dbf;
  border-color: rgba(32, 125, 255, 0.3);
  background:
    linear-gradient(145deg, rgba(121, 194, 255, 0.28), rgba(255, 255, 255, 0.58)),
    radial-gradient(90px 34px at 50% -20%, rgba(32, 125, 255, 0.2), transparent 82%);
}

.profile-block {
  padding: 14px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.18)),
    radial-gradient(300px 120px at 88% 8%, rgba(24, 195, 160, 0.16), transparent 74%);
}

.profile-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-top > div:last-child {
  min-width: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--mint));
  box-shadow: var(--shadow-soft);
}

.profile-top h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.profile-top p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.profile-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tags span {
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.20);
}

.chevron {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(127, 141, 170, 0.24);
  background: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 640;
  line-height: 1;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.list-item:hover .chevron,
.list-item:focus-visible .chevron {
  transform: translateX(2px);
  color: var(--accent);
  border-color: rgba(32, 125, 255, 0.28);
  background: rgba(255, 255, 255, 0.8);
}

.list-item:active .chevron {
  transform: translateX(2px) scale(0.96);
}

.toggle {
  position: relative;
  width: 52px;
  height: 32px;
  flex-shrink: 0;
  align-self: center;
  margin-right: 2px;
  z-index: 1;
}

.toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
}

.track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(130, 141, 163, 0.4), rgba(130, 141, 163, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(20, 30, 56, 0.1);
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.track::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(16, 24, 40, 0.26);
  transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.22s ease;
}

.toggle input:checked + .track {
  background: linear-gradient(122deg, var(--accent), #3ca6ff);
  border-color: rgba(60, 166, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 14px rgba(52, 149, 255, 0.32);
}

.toggle input:checked + .track::before {
  transform: translateX(22px);
  box-shadow: 0 5px 12px rgba(20, 62, 128, 0.28);
}

.toggle input:focus-visible + .track {
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.24);
}

.toggle:active .track {
  transform: scale(0.985);
}

.bottom-nav {
  position: fixed;
  isolation: isolate;
  overflow: hidden;
  width: min(540px, calc(100% - 20px - var(--safe-left) - var(--safe-right)));
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.4)),
    radial-gradient(180px 80px at 50% -25%, rgba(32, 125, 255, 0.18), transparent 74%);
  box-shadow: 0 16px 30px rgba(14, 21, 43, 0.18);
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 48%);
  z-index: -1;
}

.nav-active-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(148deg, rgba(59, 146, 255, 0.22), rgba(255, 255, 255, 0.24)),
    radial-gradient(92px 48px at 50% -12%, rgba(255, 255, 255, 0.6), transparent 84%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 8px 16px rgba(32, 125, 255, 0.18);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease;
}

.nav-active-indicator.is-visible {
  opacity: 1;
}

.nav-active-indicator.is-instant {
  transition: none;
}

.tab-btn {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 18px;
  min-height: 62px;
  min-width: 0;
  padding: 7px 4px 9px;
  background: transparent;
  color: var(--text-tertiary);
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  gap: 4px;
  cursor: pointer;
  transition:
    color var(--motion-mid) ease,
    transform var(--motion-fast) var(--ease-snap),
    opacity var(--motion-fast) ease,
    background-color var(--motion-mid) ease;
  overflow: hidden;
}

.tab-btn:active {
  transform: translateY(1px) scale(0.976);
}

.tab-btn::before {
  content: none;
}

.tab-btn.is-active {
  color: var(--text-primary);
  background: transparent;
}

.tab-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(127, 141, 170, 0.2);
  background: rgba(255, 255, 255, 0.46);
  display: grid;
  place-items: center;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tab-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 55%;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.tab-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease, letter-spacing 0.2s ease, font-weight 0.2s ease;
}

.tab-btn.is-active .tab-label {
  font-weight: 780;
  color: var(--text-primary);
  transform: translateY(-0.3px);
  letter-spacing: 0.004em;
}

.tab-btn:hover .tab-svg,
.tab-btn:focus-visible .tab-svg {
  transform: translateY(-1px) scale(1.04);
}

.tab-btn.is-active .tab-icon {
  border-color: rgba(32, 125, 255, 0.3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(232, 244, 255, 0.6));
  box-shadow: 0 6px 12px rgba(32, 125, 255, 0.16);
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2);
}

.tab-btn:active .tab-svg {
  transform: scale(0.94);
}

.tab-btn.is-active .tab-svg {
  transform: translateY(-1px) scale(1.06);
}

.tab-svg.is-pop {
  animation: tab-icon-pop 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tab-dirty-dot {
  position: absolute;
  top: 8px;
  right: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b57;
  box-shadow: 0 0 0 2px rgba(255, 107, 87, 0.2);
  z-index: 3;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tab-dirty-dot.is-visible {
  opacity: 1;
  transform: scale(1);
}

.pressable {
  transition: transform var(--motion-fast) var(--ease-snap), box-shadow var(--motion-mid) ease;
}

.pressable.is-pressed {
  transform: scale(0.985);
}

.focus-pulse {
  animation: focus-pulse 0.72s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.input-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  padding:
    calc(10px + var(--safe-top))
    calc(12px + var(--safe-right))
    calc(12px + var(--safe-bottom))
    calc(12px + var(--safe-left));
  display: grid;
  align-items: end;
}

.input-sheet[hidden] {
  display: none;
}

.input-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  background: rgba(10, 18, 35, 0.34);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.input-sheet-panel {
  position: relative;
  border-radius: 22px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7)),
    radial-gradient(220px 90px at 100% -12%, rgba(32, 125, 255, 0.14), transparent 76%);
  box-shadow: 0 20px 36px rgba(12, 20, 42, 0.24);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.22s var(--ease-snap), opacity 0.22s ease;
}

.input-sheet.is-open .input-sheet-panel {
  transform: translateY(0);
  opacity: 1;
}

.input-sheet-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.input-sheet-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.input-sheet-field {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.3;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-sheet-field:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2);
}

.input-sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.input-sheet-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: 0.004em;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.66);
  transition: transform var(--motion-fast) var(--ease-snap), box-shadow var(--motion-mid) ease, border-color var(--motion-mid) ease, background-color var(--motion-mid) ease;
}

.input-sheet-btn:active {
  transform: scale(0.98);
}

.input-sheet-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 125, 255, 0.2);
}

.input-sheet-btn-secondary {
  border-color: rgba(127, 141, 170, 0.26);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.54));
}

.input-sheet-btn-primary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(134deg, #0a84ff 0%, #46a0ff 100%);
  box-shadow: 0 8px 14px rgba(23, 78, 172, 0.24);
}

.draft-sheet {
  position: fixed;
  inset: 0;
  z-index: 46;
  padding:
    calc(10px + var(--safe-top))
    calc(12px + var(--safe-right))
    calc(12px + var(--safe-bottom))
    calc(12px + var(--safe-left));
  display: grid;
  align-items: end;
}

.draft-sheet[hidden] {
  display: none;
}

.draft-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  background: rgba(8, 14, 28, 0.44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.draft-sheet-panel {
  position: relative;
  display: grid;
  gap: 12px;
  max-height: min(84vh, calc(var(--viewport-height) - 20px - var(--safe-top) - var(--safe-bottom)));
  padding: 14px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.78)),
    radial-gradient(220px 100px at 100% 0%, rgba(32, 125, 255, 0.16), transparent 78%);
  box-shadow: 0 24px 44px rgba(9, 18, 38, 0.26);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.22s var(--ease-snap), opacity 0.22s ease;
}

.draft-sheet.is-open .draft-sheet-panel {
  transform: translateY(0);
  opacity: 1;
}

.draft-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.draft-sheet-copy {
  min-width: 0;
}

.draft-sheet-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.draft-sheet-head h3 {
  margin: 0;
  font-size: clamp(20px, 5.4vw, 22px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.draft-sheet-head p:last-child {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.38;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.draft-sheet-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(127, 141, 170, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  transition: transform var(--motion-fast) var(--ease-snap), background-color var(--motion-mid) ease, border-color var(--motion-mid) ease, color var(--motion-mid) ease;
}

.draft-sheet-close:active {
  transform: scale(0.97);
}

.draft-review-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 167, 36, 0.26);
  background: linear-gradient(140deg, rgba(255, 243, 214, 0.92), rgba(255, 250, 239, 0.76));
}

.draft-review-block strong {
  font-size: 14px;
  line-height: 1.2;
  color: #8a5a05;
}

.draft-review-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-review-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 184, 76, 0.36);
  color: #7a4f03;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.draft-sheet-items {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}

.draft-item-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(246, 249, 255, 0.68));
  box-shadow: 0 10px 18px rgba(19, 30, 54, 0.08);
}

.draft-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.draft-item-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.draft-item-copy strong {
  display: block;
  font-size: clamp(15px, 4.2vw, 16px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.draft-item-copy p {
  margin: 0;
  font-size: clamp(12px, 3.6vw, 13px);
  line-height: 1.35;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.draft-item-kcal {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 84px;
  max-width: 100%;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(32, 125, 255, 0.1);
  color: var(--accent);
  font-size: clamp(12px, 3.4vw, 13px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

.draft-item-meta,
.draft-item-assumptions,
.draft-item-actions,
.draft-sheet-secondary,
.draft-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-pill,
.draft-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(127, 141, 170, 0.18);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.draft-pill.is-soft {
  color: var(--text-secondary);
}

.draft-pill.is-warn {
  border-color: rgba(255, 171, 36, 0.28);
  background: rgba(255, 248, 231, 0.9);
  color: #8a5a05;
}

.draft-chip-btn {
  cursor: pointer;
  min-width: 0;
  transition: transform var(--motion-fast) var(--ease-snap), box-shadow var(--motion-mid) ease, border-color var(--motion-mid) ease, background-color var(--motion-mid) ease;
}

.draft-chip-btn:active {
  transform: scale(0.97);
}

.draft-chip-btn.is-danger {
  color: #c33c32;
  border-color: rgba(224, 84, 66, 0.24);
  background: rgba(255, 244, 242, 0.9);
}

.draft-item-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.draft-item-actions .draft-chip-btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  font-size: clamp(12px, 3.8vw, 13px);
}

.draft-sheet-secondary {
  margin-top: 2px;
}

.draft-sheet-secondary,
.draft-sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.draft-sheet-secondary .input-sheet-btn,
.draft-sheet-actions .input-sheet-btn {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 10px 12px;
  font-size: clamp(13px, 3.9vw, 15px);
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.draft-empty {
  padding: 18px 14px;
  border-radius: 18px;
  border: 1px dashed rgba(127, 141, 170, 0.24);
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  bottom: calc(88px + var(--safe-bottom));
  z-index: 40;
  border-radius: 13px;
  background: rgba(15, 22, 39, 0.86);
  color: #f4f7ff;
  padding: 10px 15px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(92vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes bell-ring {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  10% {
    transform: rotate(12deg) scale(1.03);
  }
  20% {
    transform: rotate(-10deg);
  }
  30% {
    transform: rotate(7deg);
  }
  40% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

@keyframes tab-icon-pop {
  0% {
    transform: scale(0.92);
    opacity: 0.86;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes tap-ripple {
  0% {
    opacity: 0.28;
    transform: translate(-50%, -50%) scale(0.2);
  }
  60% {
    opacity: 0.14;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes focus-pulse {
  0% {
    box-shadow: var(--shadow-card);
  }
  45% {
    box-shadow: 0 0 0 2px rgba(32, 125, 255, 0.24), 0 14px 30px rgba(32, 125, 255, 0.24);
  }
  100% {
    box-shadow: var(--shadow-card);
  }
}

@keyframes chip-shimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes chip-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

body[data-theme="dark"] .top-header {
  background:
    linear-gradient(140deg, rgba(28, 40, 63, 0.84), rgba(21, 32, 53, 0.78)),
    linear-gradient(120deg, rgba(32, 125, 255, 0.2), rgba(24, 195, 160, 0.12));
}

body[data-theme="dark"] .hero-card,
body[data-theme="dark"] .feature-hero,
body[data-theme="dark"] .profile-block,
body[data-theme="dark"] .list-item,
body[data-theme="dark"] .trend-card,
body[data-theme="dark"] .recent-list,
body[data-theme="dark"] .recent-row,
body[data-theme="dark"] .recent-empty,
body[data-theme="dark"] .btn-secondary,
body[data-theme="dark"] .priority-card {
  background: linear-gradient(145deg, rgba(29, 44, 70, 0.8), rgba(23, 34, 55, 0.66));
}

body[data-theme="dark"] .list-item {
  border-color: rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(150deg, rgba(33, 49, 76, 0.88), rgba(24, 36, 58, 0.74)),
    radial-gradient(180px 80px at 100% -10%, rgba(94, 181, 255, 0.17), transparent 76%);
  box-shadow: 0 9px 18px rgba(5, 11, 24, 0.32);
}

body[data-theme="dark"] .list-item::before {
  background: linear-gradient(126deg, rgba(166, 206, 255, 0.16), rgba(166, 206, 255, 0));
  opacity: 0.8;
}

body[data-theme="dark"] .list-item:hover,
body[data-theme="dark"] .list-item:focus-visible {
  border-color: rgba(136, 199, 255, 0.4);
}

body[data-theme="dark"] .priority-card {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(148deg, rgba(36, 54, 84, 0.9), rgba(27, 40, 65, 0.8)),
    radial-gradient(260px 140px at 96% -6%, rgba(94, 181, 255, 0.32), transparent 74%),
    radial-gradient(220px 120px at -8% 105%, rgba(68, 216, 180, 0.22), transparent 76%);
  box-shadow: 0 14px 24px rgba(4, 10, 24, 0.36);
}

body[data-theme="dark"] .priority-card:hover,
body[data-theme="dark"] .priority-card:focus-visible {
  border-color: rgba(136, 199, 255, 0.36);
  box-shadow: 0 18px 30px rgba(6, 14, 34, 0.44);
}

body[data-theme="dark"] .priority-icon {
  color: #87c5ff;
  border-color: rgba(176, 212, 255, 0.3);
  background:
    linear-gradient(145deg, rgba(45, 72, 114, 0.8), rgba(31, 49, 78, 0.86)),
    radial-gradient(80px 36px at 50% -8%, rgba(176, 212, 255, 0.22), transparent 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 14px rgba(16, 35, 65, 0.38);
}

body[data-theme="dark"] .priority-label {
  color: #93ccff;
}

body[data-theme="dark"] .priority-main span {
  color: #b9c8e0;
}

body[data-theme="dark"] .priority-cta {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(31, 49, 78, 0.88), rgba(21, 33, 56, 0.84)),
    radial-gradient(90px 34px at 50% -16%, rgba(136, 199, 255, 0.22), transparent 82%);
  color: #c2d0e8;
}

body[data-theme="dark"] .recent-empty {
  border-color: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .recent-empty.is-unlinked {
  border-color: rgba(255, 166, 94, 0.35);
  background: linear-gradient(145deg, rgba(104, 68, 30, 0.45), rgba(29, 44, 70, 0.8));
}

body[data-theme="dark"] .trend-bar-track {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

body[data-theme="dark"] .trend-bar-fill {
  background: linear-gradient(180deg, #78c3ff, #4ba8ff);
}

body[data-theme="dark"] .trend-bar-fill.is-over {
  background: linear-gradient(180deg, #ff9f87, #ff7f68);
}

body[data-theme="dark"] .recent-row.is-draft {
  border-color: rgba(255, 185, 104, 0.38);
  background: linear-gradient(145deg, rgba(94, 70, 36, 0.5), rgba(29, 44, 70, 0.8));
}

body[data-theme="dark"] .recent-row.is-draft::after {
  color: #ffd38c;
  border-color: rgba(255, 185, 104, 0.4);
  background: rgba(177, 115, 27, 0.24);
}

body[data-theme="dark"] .bottom-nav {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(148deg, rgba(25, 38, 62, 0.94), rgba(20, 31, 49, 0.8)),
    radial-gradient(180px 80px at 50% -25%, rgba(94, 181, 255, 0.24), transparent 72%);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .nav-active-indicator {
  border-color: rgba(176, 212, 255, 0.3);
  background:
    linear-gradient(148deg, rgba(80, 149, 255, 0.24), rgba(37, 58, 92, 0.68)),
    radial-gradient(92px 46px at 50% -12%, rgba(176, 212, 255, 0.28), transparent 82%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 15px rgba(15, 31, 58, 0.36);
}

body[data-theme="dark"] .tab-icon {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(20, 32, 54, 0.8);
}

body[data-theme="dark"] .tab-btn.is-active .tab-icon {
  border-color: rgba(136, 199, 255, 0.34);
  background: linear-gradient(145deg, rgba(49, 82, 131, 0.72), rgba(26, 44, 70, 0.82));
  box-shadow: 0 6px 12px rgba(16, 35, 65, 0.4);
}

body[data-theme="dark"] .btn-primary {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(126px 80px at 100% -6%, rgba(255, 255, 255, 0.2), transparent 76%),
    linear-gradient(138deg, #2f89ff 0%, #519dff 56%, #6caeff 100%);
  box-shadow: 0 12px 24px rgba(15, 42, 94, 0.46), 0 4px 10px rgba(9, 26, 56, 0.34);
}

body[data-theme="dark"] .btn-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(124px 76px at 100% -12%, rgba(94, 181, 255, 0.24), transparent 74%),
    linear-gradient(150deg, rgba(33, 49, 76, 0.82), rgba(24, 36, 58, 0.72));
  box-shadow: 0 11px 22px rgba(9, 16, 35, 0.35);
}

body[data-theme="dark"] .btn-secondary .btn-glyph {
  background: rgba(20, 32, 56, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px rgba(3, 9, 24, 0.36);
}

body[data-theme="dark"] .btn-primary .btn-glyph {
  background: rgba(174, 211, 255, 0.22);
}

body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .input-card {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 22px rgba(6, 12, 26, 0.33);
}

body[data-theme="dark"] .settings-card {
  background:
    linear-gradient(148deg, rgba(32, 47, 74, 0.86), rgba(24, 36, 58, 0.74)),
    radial-gradient(260px 110px at 100% -8%, rgba(94, 181, 255, 0.16), transparent 74%);
}

body[data-theme="dark"] .preset-card {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(32, 47, 74, 0.84), rgba(24, 36, 58, 0.72)),
    radial-gradient(220px 88px at 100% -12%, rgba(136, 199, 255, 0.18), transparent 74%);
  box-shadow: 0 12px 22px rgba(6, 12, 26, 0.33);
}

body[data-theme="dark"] .preset-segmented {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(25, 39, 63, 0.86), rgba(20, 31, 49, 0.76)),
    radial-gradient(130px 54px at 50% -30%, rgba(94, 181, 255, 0.24), transparent 76%);
}

body[data-theme="dark"] .preset-btn:hover {
  background: rgba(29, 44, 70, 0.9);
}

body[data-theme="dark"] .preset-btn.is-active {
  background:
    linear-gradient(130deg, rgba(94, 181, 255, 0.3), rgba(36, 56, 88, 0.9)),
    radial-gradient(90px 40px at 50% -20%, rgba(176, 212, 255, 0.3), transparent 84%);
  box-shadow: 0 8px 14px rgba(12, 30, 59, 0.45);
}

body[data-theme="dark"] .feature-hero {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(146deg, rgba(35, 52, 82, 0.9), rgba(25, 37, 60, 0.8)),
    radial-gradient(280px 128px at 100% -8%, rgba(124, 145, 255, 0.3), transparent 74%),
    radial-gradient(180px 90px at -8% 110%, rgba(68, 216, 180, 0.18), transparent 76%);
  box-shadow: 0 14px 26px rgba(5, 11, 24, 0.36);
}

body[data-theme="dark"] .feature-hero-copy .eyebrow {
  color: #9db4ff;
}

body[data-theme="dark"] .feature-hero-icon {
  color: #a7b9ff;
  border-color: rgba(176, 212, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(53, 73, 118, 0.8), rgba(38, 54, 86, 0.84)),
    radial-gradient(90px 36px at 50% -10%, rgba(176, 212, 255, 0.24), transparent 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 14px rgba(16, 35, 65, 0.38);
}

body[data-theme="dark"] .feature-hero-chip {
  color: #b8c5dc;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(32, 47, 74, 0.9), rgba(22, 34, 56, 0.84)),
    radial-gradient(90px 34px at 50% -20%, rgba(136, 199, 255, 0.15), transparent 80%);
}

body[data-theme="dark"] .feature-hero-chip.is-accent {
  color: #9fd0ff;
  border-color: rgba(136, 199, 255, 0.36);
  background:
    linear-gradient(145deg, rgba(55, 83, 129, 0.8), rgba(29, 46, 74, 0.84)),
    radial-gradient(90px 34px at 50% -20%, rgba(136, 199, 255, 0.24), transparent 82%);
}

body[data-theme="dark"] .hero-chip {
  background: rgba(31, 45, 73, 0.84);
}

body[data-theme="dark"] .sync-chip.is-loading {
  background: rgba(21, 33, 56, 0.72);
}

body[data-theme="dark"] .sync-chip::after {
  background: linear-gradient(105deg, transparent 32%, rgba(176, 205, 255, 0.24) 50%, transparent 68%);
}

body[data-theme="dark"] .sync-chip.is-ready {
  color: #67d7b9;
  border-color: rgba(103, 215, 185, 0.35);
  background: rgba(50, 149, 126, 0.25);
}

body[data-theme="dark"] .sync-chip.is-error {
  color: #ff9cab;
  border-color: rgba(255, 156, 171, 0.35);
  background: rgba(149, 53, 74, 0.26);
}

body[data-theme="dark"] .sync-chip.is-demo {
  color: #b4c0d9;
  background: rgba(21, 33, 56, 0.62);
}

body[data-theme="dark"] .hero-chip-neutral {
  background: rgba(21, 33, 56, 0.76);
}

body[data-theme="dark"] .hero-chip-neutral.is-good {
  color: #67d7b9;
  border-color: rgba(103, 215, 185, 0.35);
  background: rgba(50, 149, 126, 0.25);
}

body[data-theme="dark"] .hero-chip-neutral.is-warn {
  color: #ffcf7b;
  border-color: rgba(255, 206, 120, 0.35);
  background: rgba(177, 115, 27, 0.25);
}

body[data-theme="dark"] .hero-chip-neutral.is-danger {
  color: #ff9cab;
  border-color: rgba(255, 156, 171, 0.35);
  background: rgba(149, 53, 74, 0.26);
}

body[data-theme="dark"] .hero-stat {
  background: rgba(21, 33, 56, 0.72);
}

body[data-theme="dark"] .recent-badge {
  background: rgba(21, 33, 56, 0.72);
}

body[data-theme="dark"] .settings-summary {
  border-color: rgba(136, 199, 255, 0.26);
  background:
    linear-gradient(145deg, rgba(94, 181, 255, 0.2), rgba(94, 181, 255, 0.08)),
    linear-gradient(145deg, rgba(24, 37, 60, 0.8), rgba(18, 28, 46, 0.66));
}

body[data-theme="dark"] .setting-row {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(148deg, rgba(33, 49, 76, 0.88), rgba(24, 36, 58, 0.74)),
    radial-gradient(150px 70px at 100% -12%, rgba(94, 181, 255, 0.16), transparent 76%);
  box-shadow: 0 10px 18px rgba(4, 9, 22, 0.32);
}

body[data-theme="dark"] .setting-row::after {
  background: linear-gradient(126deg, rgba(166, 206, 255, 0.16), rgba(166, 206, 255, 0));
}

body[data-theme="dark"] .setting-row.is-on {
  border-color: rgba(136, 199, 255, 0.44);
  background:
    linear-gradient(148deg, rgba(36, 54, 83, 0.92), rgba(27, 40, 64, 0.82)),
    radial-gradient(150px 70px at 100% -12%, rgba(94, 181, 255, 0.26), transparent 76%);
}

body[data-theme="dark"] .setting-row.is-on::before {
  box-shadow: 0 0 0 4px rgba(94, 181, 255, 0.2);
}

body[data-theme="dark"] .setting-row.is-off::before {
  background: rgba(156, 170, 196, 0.7);
  box-shadow: 0 0 0 4px rgba(156, 170, 196, 0.12);
}

body[data-theme="dark"] .save-hint.is-visible {
  border-color: rgba(255, 199, 102, 0.35);
  background: rgba(170, 118, 29, 0.24);
  color: #ffd38c;
}

body[data-theme="dark"] .setting-row:hover {
  border-color: rgba(136, 199, 255, 0.38);
  background: linear-gradient(145deg, rgba(36, 54, 84, 0.88), rgba(27, 40, 65, 0.76));
}

body[data-theme="dark"] .setting-row:active {
  background: linear-gradient(145deg, rgba(31, 46, 74, 0.9), rgba(24, 36, 58, 0.78));
}

body[data-theme="dark"] .input-card input {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(19, 30, 52, 0.8);
}

body[data-theme="dark"] .input-card input:focus {
  background: rgba(24, 40, 67, 0.9);
}

body[data-theme="dark"] .track {
  background: linear-gradient(130deg, rgba(120, 133, 156, 0.52), rgba(120, 133, 156, 0.34));
  border-color: rgba(255, 255, 255, 0.18);
}

body[data-theme="dark"] .track::before {
  background: #edf3ff;
}

body[data-theme="dark"] .chevron {
  color: #afbdd6;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(19, 30, 52, 0.8);
}

body[data-theme="dark"] .icon-button.is-active {
  color: #78efcd;
  border-color: rgba(120, 239, 205, 0.32);
  background: linear-gradient(145deg, rgba(40, 120, 102, 0.45), rgba(26, 64, 71, 0.44));
  box-shadow: 0 12px 24px rgba(40, 120, 102, 0.3);
}

body[data-theme="dark"] .tap-ripple {
  background: radial-gradient(circle, rgba(136, 199, 255, 0.34), rgba(136, 199, 255, 0));
}

body[data-theme="dark"] .input-sheet-backdrop {
  background: rgba(3, 8, 18, 0.5);
}

body[data-theme="dark"] .input-sheet-panel {
  background:
    linear-gradient(145deg, rgba(26, 40, 64, 0.95), rgba(21, 33, 54, 0.86)),
    radial-gradient(220px 90px at 100% -12%, rgba(94, 181, 255, 0.2), transparent 76%);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.44);
}

body[data-theme="dark"] .input-sheet-field {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(19, 30, 52, 0.84);
}

body[data-theme="dark"] .input-sheet-field:focus {
  background: rgba(24, 40, 67, 0.94);
}

body[data-theme="dark"] .input-sheet-btn-secondary {
  color: #d3ddf3;
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, rgba(34, 51, 80, 0.92), rgba(23, 36, 58, 0.86));
}

body[data-theme="dark"] .draft-sheet-backdrop {
  background: rgba(3, 7, 16, 0.7);
}

body[data-theme="dark"] .draft-sheet-panel {
  background:
    linear-gradient(148deg, rgba(22, 34, 56, 0.96), rgba(16, 25, 42, 0.88)),
    radial-gradient(240px 100px at 100% 0%, rgba(94, 181, 255, 0.18), transparent 78%);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .draft-sheet-close,
body[data-theme="dark"] .draft-chip-btn,
body[data-theme="dark"] .draft-pill,
body[data-theme="dark"] .draft-item-card {
  background: rgba(27, 39, 63, 0.88);
  border-color: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"] .draft-review-block {
  background: linear-gradient(140deg, rgba(69, 48, 17, 0.82), rgba(57, 40, 15, 0.7));
  border-color: rgba(255, 188, 85, 0.22);
}

body[data-theme="dark"] .draft-review-block strong,
body[data-theme="dark"] .draft-review-chip,
body[data-theme="dark"] .draft-pill.is-warn {
  color: #ffd38b;
}

body[data-theme="dark"] .draft-review-chip,
body[data-theme="dark"] .draft-pill.is-warn {
  background: rgba(78, 56, 20, 0.74);
  border-color: rgba(255, 188, 85, 0.24);
}

body[data-theme="dark"] .draft-chip-btn.is-danger {
  color: #ff9a8f;
  background: rgba(76, 31, 31, 0.82);
  border-color: rgba(255, 112, 96, 0.22);
}

body[data-theme="dark"] .draft-empty {
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 380px) {
  .top-header {
    align-items: flex-start;
  }

  .header-pill {
    display: none;
  }

  .hero-card h2,
  .feature-hero h2,
  .profile-block h2 {
    font-size: 26px;
  }

  .feature-hero {
    gap: 10px;
    padding: 14px;
  }

  .feature-hero-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .feature-hero-chip {
    min-height: 25px;
    padding: 0 9px;
    font-size: 11px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stat:last-child {
    grid-column: 1 / -1;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    min-height: 74px;
    padding: 12px;
  }

  .hero-top {
    flex-direction: column;
    gap: 12px;
  }

  .ring {
    --size: 70px;
  }

  .priority-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .priority-cta {
    grid-column: 2;
    justify-self: start;
    min-height: 30px;
  }

  .setting-row {
    column-gap: 10px;
    padding: 12px 11px;
    min-height: 72px;
  }

  .setting-row strong {
    font-size: 14px;
  }

  .setting-row p {
    font-size: 12px;
    line-height: 1.28;
  }

  .recent-list {
    border-radius: 18px;
    padding: 8px;
  }

  .trend-card {
    border-radius: 18px;
    padding: 9px 8px 10px;
  }

  .trend-chart {
    min-height: 132px;
    gap: 6px;
  }

  .trend-bar-track {
    height: 90px;
  }

  .recent-row {
    border-radius: 14px;
    min-height: 68px;
    padding: 11px 11px;
  }

  .recent-title {
    font-size: 14px;
  }

  .recent-kcal {
    font-size: 14px;
  }

  .list-item {
    min-height: 68px;
    padding: 12px;
    border-radius: 18px;
  }

  .list-item::before {
    opacity: 0.54;
  }

  .chevron {
    width: 28px;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 17px;
  }

  .input-card input {
    min-height: 52px;
    font-size: 22px;
    padding: 0 14px;
  }

  .preset-card {
    border-radius: 18px;
    padding: 12px;
  }

  .preset-btn {
    min-height: 42px;
    font-size: 13px;
  }

  .tab-label {
    font-size: 11px;
  }

  .bottom-nav {
    width: min(540px, calc(100% - 16px - var(--safe-left) - var(--safe-right)));
    padding: 7px;
    gap: 6px;
  }

  .tab-btn {
    min-height: 56px;
    border-radius: 14px;
  }
}

@media (max-width: 420px) {
  .settings-summary {
    padding: 10px 11px;
  }

  .toggle {
    width: 48px;
    height: 30px;
  }

  .track::before {
    width: 22px;
    height: 22px;
  }

  .toggle input:checked + .track::before {
    transform: translateX(20px);
  }

  .draft-sheet-panel {
    gap: 10px;
    padding: 13px;
    border-radius: 22px;
  }

  .draft-sheet-head {
    gap: 10px;
  }

  .draft-sheet-close {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 15px;
  }

  .draft-item-card {
    padding: 12px;
    border-radius: 18px;
  }

  .draft-review-block {
    padding: 11px;
  }

  .draft-review-chip {
    min-height: 27px;
    padding: 6px 9px;
    font-size: 11.5px;
  }
}

@media (max-width: 460px) {
  .button-row {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stat:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  .app-shell {
    padding:
      calc(12px + var(--safe-top))
      calc(12px + var(--safe-right))
      calc(106px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .header-copy h1 {
    font-size: 22px;
  }

  .list-item strong {
    font-size: 15px;
  }

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

  .list-item {
    min-height: 64px;
    padding: 10px 10px 10px 11px;
  }

  .list-item::before {
    opacity: 0.48;
  }

  .btn-copy strong {
    font-size: 14px;
  }

  .btn-copy small {
    font-size: 10px;
  }

  .priority-main strong {
    font-size: 16px;
  }

  .priority-main span {
    font-size: 13px;
  }

  .draft-sheet {
    padding:
      calc(8px + var(--safe-top))
      calc(8px + var(--safe-right))
      calc(10px + var(--safe-bottom))
      calc(8px + var(--safe-left));
  }

  .draft-sheet-panel {
    gap: 9px;
    padding: 11px;
    border-radius: 20px;
  }

  .draft-sheet-head {
    gap: 8px;
  }

  .draft-sheet-close {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .draft-item-head {
    gap: 8px;
  }

  .draft-item-kcal {
    min-width: 74px;
    min-height: 30px;
    padding: 0 9px;
  }

  .draft-item-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-item-actions .draft-chip-btn:last-child {
    grid-column: 1 / -1;
  }

  .draft-sheet-secondary,
  .draft-sheet-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .draft-sheet-secondary .input-sheet-btn,
  .draft-sheet-actions .input-sheet-btn {
    min-height: 52px;
    font-size: 13px;
  }
}

@media (min-width: 700px) {
  .app-shell {
    padding-top: calc(18px + var(--safe-top));
    padding-left: calc(18px + var(--safe-left));
    padding-right: calc(18px + var(--safe-right));
  }

  .panel {
    gap: 11px;
  }

  .list-item {
    padding: 15px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
