@font-face {
  font-family: "LINE Seed TW";
  src: local("LINE Seed Sans TW"), local("LINE Seed TW"), local("LINESeedTW"), local("LINE Seed Sans TC");
  font-display: swap;
}

:root {
  --bg: #fff8f3;
  --surface: #ffffff;
  --surface-strong: #fff1ea;
  --ink: #2c2524;
  --muted: #756965;
  --line: #eadbd2;
  --accent: #d7566f;
  --accent-dark: #9c334b;
  --accent-soft: #ffd8df;
  --teal: #138477;
  --blue: #4d6fa8;
  --amber: #bc7523;
  --shadow: 0 18px 50px rgba(87, 53, 42, 0.12);
  font-family: "LINE Seed TW", "LINE Seed Sans TW", "LINE Seed Sans TC", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 248, 243, 0.96), rgba(247, 244, 237, 0.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='%23f3d8cc' fill-opacity='.38' d='M60 8c13 0 24 11 24 24S73 56 60 56 36 45 36 32 47 8 60 8Zm0 64c11 0 20 9 20 20s-9 20-20 20-20-9-20-20 9-20 20-20Z'/%3E%3C/svg%3E");
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(320px, 440px);
  align-items: center;
  justify-content: center;
  gap: 64px;
  min-height: 100vh;
  padding: 32px;
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-logo {
  width: min(310px, 82vw);
  height: auto;
}

.auth-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.phone-preview {
  display: grid;
  gap: 18px;
  width: min(100%, 360px);
  min-height: 640px;
  border: 10px solid #2c2524;
  border-radius: 34px;
  padding: 26px;
  background: linear-gradient(160deg, #fff, #fff1ea 55%, #f8ded2);
  box-shadow: 0 28px 80px rgba(44, 37, 36, 0.22);
}

.mini-status {
  width: 72px;
  height: 8px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #2c2524;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mini-card.large {
  min-height: 210px;
  background:
    linear-gradient(135deg, rgba(215, 86, 111, 0.18), rgba(19, 132, 119, 0.12)),
    #fff;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mini-grid span {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.app-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 92px 28px 28px;
}

.global-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(234, 219, 210, 0.86);
  background: rgba(255, 250, 247, 0.92);
  box-shadow: 0 12px 34px rgba(72, 45, 38, 0.08);
  backdrop-filter: blur(18px);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  height: 44px;
  text-decoration: none;
}

.navbar-brand img {
  display: block;
  width: auto;
  max-width: 62vw;
  height: 48px;
  object-fit: contain;
}

.navbar-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.navbar-menu span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.navbar-menu span + span {
  margin-top: 0;
}

body.menu-open .navbar-menu span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.menu-open .navbar-menu span:nth-child(2) {
  opacity: 0;
}

body.menu-open .navbar-menu span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.app-dim-layer {
  position: fixed;
  inset: 72px 0 0;
  z-index: 25;
  display: none;
  border: 0;
  background: rgba(44, 37, 36, 0.42);
  backdrop-filter: blur(2px);
}

body.menu-open .app-dim-layer,
body.settings-open .app-dim-layer {
  display: block;
}

.mobile-app-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 430px);
  min-height: calc(100vh - 56px);
  max-height: 932px;
  overflow: hidden;
  border: 1px solid rgba(234, 219, 210, 0.86);
  border-radius: 30px;
  background: linear-gradient(180deg, #fffaf7 0%, #fff8f3 58%, #ffffff 100%);
  box-shadow: 0 28px 90px rgba(72, 45, 38, 0.18);
}

.sidebar {
  position: relative;
  top: auto;
  height: auto;
  padding: 16px 16px 0;
  border-right: 0;
  background: transparent;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.app-topbar {
  display: none;
  grid-template-columns: 48px minmax(0, 1fr);
}

.brand-logo {
  width: 148px;
  height: auto;
}

.brand-icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: left center;
  border-radius: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.profile-panel h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.25rem;
}

.brand p,
.eyebrow,
.status-card span,
.metric span,
.panel-header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 26px;
}

.nav-tab {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 0 14px;
}

.nav-tab.active {
  color: var(--accent-dark);
  border-color: var(--accent-soft);
  background: var(--surface-strong);
  font-weight: 700;
}

.user-strip {
  display: none;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

body.menu-open .user-strip {
  position: absolute;
  right: 16px;
  left: 16px;
  top: 84px;
  z-index: 35;
  display: grid;
  border-radius: 20px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.user-strip strong,
.user-strip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-strip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-panel,
.panel,
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.profile-panel {
  display: none;
  gap: 14px;
  padding: 16px;
}

body.settings-open .profile-panel {
  position: absolute;
  right: 16px;
  left: 16px;
  top: 84px;
  z-index: 35;
  display: grid;
  border-radius: 20px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

input[type="date"] {
  max-width: 100%;
  min-width: 0;
  min-height: 43px;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.25;
}

.date-field {
  overflow: hidden;
}

.date-picker-shell {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 100%;
  min-height: 43px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.date-picker-shell input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-display {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  resize: vertical;
}

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

main {
  min-width: 0;
  overflow-y: auto;
  padding: 8px 16px 118px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.topbar h2 {
  font-size: 1.35rem;
  line-height: 1.18;
}

.app-greeting {
  align-items: flex-start;
}

.cycle-hero {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 14px 18px;
  background:
    radial-gradient(circle at 50% 62%, rgba(215, 86, 111, 0.2), transparent 48%),
    linear-gradient(180deg, #ffecef, #fffaf7 78%);
  box-shadow: 0 18px 50px rgba(215, 86, 111, 0.14);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.week-day {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.76rem;
}

.week-day strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.week-day.today {
  color: #fff;
  background: var(--accent);
}

.week-day.today strong {
  color: #fff;
}

.cycle-orb {
  display: grid;
  place-items: center;
  margin: 8px 0 14px;
}

.cycle-ring {
  --progress: 0deg;
  display: grid;
  width: min(72vw, 260px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.92) 0),
    #fff;
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.9), 0 24px 48px rgba(156, 51, 75, 0.18);
}

.cycle-ring-inner {
  display: grid;
  width: calc(100% - 44px);
  height: calc(100% - 44px);
  place-items: center;
  border-radius: 50%;
  padding: 28px;
  background: #fff;
  text-align: center;
}

.cycle-ring-inner span,
.cycle-ring-inner small {
  color: var(--muted);
}

.cycle-ring-inner strong {
  color: var(--ink);
  font-size: 2.05rem;
  line-height: 1.05;
}

.log-period-button {
  display: block;
  width: fit-content;
  min-height: 46px;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 0 26px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(215, 86, 111, 0.26);
  font-weight: 900;
}

.daily-prompt {
  margin: 14px 0;
}

.prompt-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 12px 30px rgba(87, 53, 42, 0.08);
  text-align: left;
}

.prompt-card span {
  display: grid;
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
  align-self: center;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.prompt-card strong,
.prompt-card small {
  grid-column: 2;
}

.prompt-card strong {
  align-self: end;
}

.prompt-card small {
  align-self: start;
}

.prompt-card small {
  color: var(--muted);
}

.compact {
  justify-content: center;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin: 2px 0 16px;
}

.calendar-toolbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
  text-align: center;
}

.month-nav-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 22px rgba(87, 53, 42, 0.08);
}

.month-nav-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.status-card {
  min-height: 126px;
  padding: 14px;
}

.status-card strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--accent-dark);
  font-size: 1.22rem;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.phase-card {
  background: linear-gradient(145deg, #ffffff, #fff0f3);
}

.home-launcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}

.launcher-tile {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(87, 53, 42, 0.08);
  text-align: center;
}

.launcher-tile:hover {
  border-color: var(--accent-soft);
  background: #fffaf7;
}

.primary-tile:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
}

.launcher-tile strong,
.launcher-tile small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.launcher-tile strong {
  font-size: 0.96rem;
  line-height: 1.25;
}

.launcher-tile small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.launcher-icon {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.launcher-tile[data-go-view="log"] .launcher-icon {
  transform: translateY(1px);
}

.primary-tile {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
}

.primary-tile small {
  color: rgba(255, 255, 255, 0.82);
}

.primary-tile .launcher-icon {
  color: #fff;
  background: transparent;
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.quick-chips,
.legend,
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: #fff;
}

.chip.selected {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.choice-chip {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.choice-chip input:checked + span {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 800;
}

.choice-chip input:focus-visible + span {
  outline: 3px solid rgba(215, 86, 111, 0.28);
  outline-offset: 2px;
}

.note-field {
  margin: 16px 0;
}

.primary-action,
.ghost-button,
.danger-button,
.icon-action {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.primary-action {
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.ghost-button,
.icon-action {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.danger-button {
  color: white;
  background: #a43b3b;
}

.icon-action {
  width: 42px;
  padding: 0;
  font-weight: 800;
}

.reminder-list,
.history-list,
.tips-list {
  display: grid;
  gap: 10px;
}

.reminder-item,
.history-item,
.tip-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf7;
}

.history-item strong,
.history-item p {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  color: var(--ink);
}

.weekday,
.day-cell {
  min-height: 44px;
  border-radius: 8px;
}

.weekday {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  min-height: 104px;
  border: 1px solid var(--line);
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.day-cell.empty {
  background: rgba(255, 255, 255, 0.38);
}

.day-cell.today {
  outline: 2px solid var(--accent);
}

.day-number {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  min-height: 24px;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.tags {
  position: absolute;
  right: 5px;
  bottom: 6px;
  left: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0;
  justify-content: center;
}

.tag {
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.tag.period {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.predicted {
  background: #ffe8c9;
  color: #8a5317;
}

.tag.fertile {
  background: #d5f0ea;
  color: #0b655a;
}

.tag.ovulation {
  background: #dfe8ff;
  color: #304f8d;
}

.tag.logged {
  background: #eee5dc;
  color: #665246;
}

.legend {
  margin-bottom: 16px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.period {
  background: var(--accent);
}

.dot.predicted {
  background: var(--amber);
}

.dot.fertile {
  background: var(--teal);
}

.dot.ovulation {
  background: var(--blue);
}

.dot.logged {
  background: #806b5d;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

#detailLogForm {
  grid-template-columns: 1fr;
}

.wide {
  grid-column: 1 / -1;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 2rem;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e5de;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.data-panel p {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 4px;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.app-footer strong {
  color: var(--accent-dark);
  font-weight: 900;
  white-space: nowrap;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: min(calc(100vw - 32px), 398px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.bottom-tab {
  display: grid;
  grid-template-rows: 28px auto;
  gap: 2px;
  min-height: 52px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 0.75rem;
}

.tab-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px;
  color: currentColor;
  background: transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab-icon img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.bottom-tab.active .tab-icon {
  transform: translateY(-1px);
}

.center-action .tab-icon {
  transform: translateY(-1px) scale(1.08);
}

.bottom-tab.active {
  color: var(--accent-dark);
  background: var(--surface-strong);
  font-weight: 800;
}

dialog {
  width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(44, 37, 36, 0.34);
}

dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
}

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .phone-preview {
    display: none;
  }

  .status-grid,
  .split-layout,
  .form-grid,
  .insight-grid,
  .home-launcher {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 72px 0 0;
  }

  .mobile-app-frame {
    min-height: calc(100vh - 72px);
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .global-navbar {
    min-height: 72px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .navbar-brand img {
    width: auto;
    height: 44px;
  }

  .bottom-tabs {
    width: calc(100vw - 24px);
  }

  .auth-screen {
    align-content: center;
    padding: 18px;
  }

  .auth-card {
    padding: 20px;
  }

  main,
  .sidebar {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .status-grid,
  .split-layout,
  .form-grid,
  .insight-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .option-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .status-card {
    min-height: 132px;
    padding: 14px;
  }

  .status-card strong {
    font-size: 1.25rem;
  }

  .home-launcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .launcher-tile {
    min-height: 86px;
    padding: 10px 6px;
  }

  .launcher-icon {
    width: 54px;
    height: 54px;
  }

  .nav-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-cell {
    min-height: 78px;
    padding: 0;
  }

  .tag {
    font-size: 0.65rem;
  }

  .bar-row {
    grid-template-columns: 72px minmax(0, 1fr) 28px;
  }
}
