:root {
  --ink: #14252e;
  --muted: #67757b;
  --paper: #f4f2ec;
  --card: #fffdf8;
  --card-strong: #ffffff;
  --line: #e4e0d7;
  --navy: #122b38;
  --navy-soft: #e5ecee;
  --teal: #167f72;
  --teal-bright: #5ed1b8;
  --teal-soft: #dcf4ed;
  --amber: #d99522;
  --amber-soft: #fff0cc;
  --red: #b94e45;
  --red-soft: #fbe4e0;
  --blue: #2c6b8d;
  --blue-soft: #e3eff5;
  --shadow: 0 16px 40px rgba(22, 38, 45, 0.08);
  --shadow-soft: 0 8px 22px rgba(22, 38, 45, 0.06);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(94, 209, 184, 0.12), transparent 25rem),
    var(--paper);
}

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

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

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 127, 114, 0.24);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 860px);
  min-height: 100vh;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: max(10px, env(safe-area-inset-top, 0px)) 18px 10px;
  background: rgba(244, 242, 236, 0.9);
  border-bottom: 1px solid rgba(228, 224, 215, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(18, 43, 56, 0.16);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  stroke: var(--card);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn,
.primary-icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.78);
}

.primary-icon-btn {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
}

.icon-btn svg,
.primary-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-content {
  padding: 18px 16px calc(105px + var(--safe-bottom));
}

.view-enter {
  animation: rise-in 220ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 2px 16px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-action {
  flex: 0 0 auto;
}

.heading-action-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.heading-action-group .mini-btn {
  min-height: 42px;
  background: var(--card);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  color: white;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 12%, rgba(94, 209, 184, 0.48) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 20%, rgba(94, 209, 184, 0.32) 0 32px, transparent 33px),
    linear-gradient(140deg, #0e2632, #173d47 65%, #265d5d);
  box-shadow: 0 20px 45px rgba(18, 43, 56, 0.2);
}

.hero-card::after {
  position: absolute;
  right: -32px;
  bottom: -58px;
  width: 176px;
  height: 176px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
}

.hero-card h2 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(24px, 7.5vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.hero-card h2 em {
  color: var(--teal-bright);
  font-style: normal;
}

.hero-card p {
  max-width: 440px;
  margin: 11px 0 20px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 750;
  border: 0;
  border-radius: 13px;
  background: white;
}

.hero-button.secondary {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.hero-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 5px;
  padding: 0 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
  border: 0;
  background: transparent;
}

.text-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.stat-card {
  min-width: 0;
  padding: 15px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.74);
  box-shadow: var(--shadow-soft);
}

.stat-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.stat-card span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card.alert strong {
  color: var(--red);
}

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

.quick-card {
  display: grid;
  min-height: 126px;
  padding: 17px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.quick-card .quick-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--teal);
  border-radius: 12px;
  background: var(--teal-soft);
}

.quick-card:nth-child(2) .quick-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.quick-card:nth-child(3) .quick-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.quick-card:nth-child(4) .quick-icon {
  color: var(--navy);
  background: var(--navy-soft);
}

.quick-card svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-card strong {
  align-self: end;
  margin-top: 14px;
  font-size: 14px;
}

.quick-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.list-stack {
  display: grid;
  gap: 11px;
}

.card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.card.clickable {
  cursor: pointer;
}

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

.card-title-wrap {
  min-width: 0;
}

.card h3 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-subtitle {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 13px;
  color: #44555d;
  font-size: 12px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.tag,
.status-badge,
.warning-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 9px;
  color: #526168;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 99px;
  background: #f0eee8;
}

.tag.skill {
  color: var(--blue);
  background: var(--blue-soft);
}

.tag.good {
  color: var(--teal);
  background: var(--teal-soft);
}

.tag.warn,
.warning-badge {
  color: #875b0d;
  background: var(--amber-soft);
}

.tag.danger {
  color: var(--red);
  background: var(--red-soft);
}

.status-badge.open {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.paused {
  color: #875b0d;
  background: var(--amber-soft);
}

.status-badge.closed {
  color: #647176;
  background: #e9e8e3;
}

.status-badge.new {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-badge.interview {
  color: #795a99;
  background: #eee6f7;
}

.status-badge.placed {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.not-fit {
  color: #777;
  background: #ececec;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #eeeae2;
}

.card-actions .mini-btn {
  flex: 1;
}

.mini-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-strong);
}

.mini-btn.accent {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.mini-btn.danger {
  color: var(--red);
}

.mini-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.person-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  border-radius: 15px;
  background: var(--teal-soft);
}

.avatar.alt-1 {
  color: #78591b;
  background: var(--amber-soft);
}

.avatar.alt-2 {
  color: #315f7d;
  background: var(--blue-soft);
}

.avatar.alt-3 {
  color: #75538e;
  background: #eee6f7;
}

.person-content {
  min-width: 0;
}

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

.person-top h3 {
  white-space: normal;
}

.person-status {
  flex: 0 0 auto;
}

.completeness {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.completeness-track {
  overflow: hidden;
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #eae7df;
}

.completeness-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.completeness small {
  color: var(--muted);
  font-size: 10px;
}

.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-hint {
  margin: -4px 3px 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.find-panel {
  display: grid;
  gap: 16px;
  padding: 19px;
  border: 1px solid #d8e3df;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 95% 10%, rgba(94, 209, 184, 0.2), transparent 10rem),
    var(--card);
  box-shadow: var(--shadow-soft);
}

.find-panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.find-panel > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.find-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.find-input-wrap {
  position: relative;
}

.find-input-wrap svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
}

.find-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 12px 0 40px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.find-input-row .primary-btn {
  min-height: 48px;
  padding: 0 17px;
}

.search-bar svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
}

.search-bar input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.search-bar input::placeholder {
  color: #99a1a3;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px 14px;
  padding: 2px 16px 5px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 253, 248, 0.7);
}

.filter-chip.is-active {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
  border: 1px dashed #d8d3c8;
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.55);
}

.empty-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  place-items: center;
  color: var(--teal);
  border-radius: 20px;
  background: var(--teal-soft);
}

.empty-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 17px;
}

.empty-state p {
  max-width: 310px;
  margin: 0 auto 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: white;
  font-size: 13px;
  font-weight: 750;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
}

.primary-btn svg,
.secondary-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-btn {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card-strong);
}

.danger-btn {
  color: var(--red);
  border: 1px solid #f1c8c2;
  background: var(--red-soft);
}

.full-width {
  width: 100%;
}

.match-builder {
  padding: 19px;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 13px;
  background: #eae7df;
}

.segmented button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--card-strong);
  box-shadow: 0 3px 9px rgba(20, 37, 46, 0.08);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  height: 50px;
  padding: 0 42px 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  appearance: none;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.match-result {
  margin-top: 13px;
}

.score-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.score-ring {
  --score: 0;
  --score-color: var(--teal);
  position: relative;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #ebe7df 0);
}

.score-ring::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--card);
  content: "";
}

.score-ring-content {
  position: relative;
  display: grid;
  text-align: center;
}

.score-ring-content strong {
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.score-ring-content small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.score-summary h3 {
  margin: 0;
  font-size: 17px;
}

.score-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.reason-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.reason-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.55;
  border-radius: 12px;
  background: var(--teal-soft);
}

.reason-item.warn {
  background: var(--amber-soft);
}

.reason-item.danger {
  background: var(--red-soft);
}

.reason-symbol {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.reason-item.warn .reason-symbol {
  color: var(--amber);
}

.reason-item.danger .reason-symbol {
  color: var(--red);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.rank-list {
  display: grid;
  gap: 9px;
}

.rank-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 26px;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.rank-score {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: var(--teal);
  font-size: 16px;
  font-weight: 850;
  border-radius: 14px;
  background: var(--teal-soft);
}

.rank-score.mid {
  color: #8d630f;
  background: var(--amber-soft);
}

.rank-score.low {
  color: var(--red);
  background: var(--red-soft);
}

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

.rank-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  border-radius: 9px;
  background: #f2f0eb;
}

.rank-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-banner {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 13px;
  color: #56656b;
  font-size: 11px;
  line-height: 1.6;
  border-radius: 13px;
  background: var(--navy-soft);
}

.info-banner svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 860px);
  min-height: 70px;
  margin: 0 auto;
  padding: 7px 12px calc(7px + var(--safe-bottom));
  border-top: 1px solid rgba(222, 217, 207, 0.9);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 -12px 28px rgba(20, 37, 46, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  min-height: 56px;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 3px;
  color: #7b8588;
  font-size: 10px;
  font-weight: 650;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  color: var(--navy);
  background: var(--navy-soft);
}

.sheet-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 28px;
  background: rgba(11, 27, 34, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.sheet {
  display: flex;
  overflow: hidden;
  width: min(100%, 660px);
  max-height: calc(100dvh - 28px);
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--paper);
  box-shadow: 0 -24px 70px rgba(5, 18, 24, 0.25);
  animation: sheet-in 240ms cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

@keyframes sheet-in {
  from {
    transform: translateY(5%);
  }
  to {
    transform: translateY(0);
  }
}

.sheet-grabber {
  width: 38px;
  height: 4px;
  margin: 9px auto 1px;
  border-radius: 99px;
  background: #cbc6bb;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 10px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px 18px calc(24px + var(--safe-bottom));
}

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

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field > span,
.field-label {
  color: #43545c;
  font-size: 11px;
  font-weight: 750;
}

.form-field > span b {
  color: var(--red);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid #dad5cb;
  border-radius: 12px;
  background: #fff;
}

.form-field textarea {
  min-height: 94px;
  line-height: 1.6;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #a0a6a6;
}

.form-help {
  margin: -2px 0 0;
  color: #899295;
  font-size: 10px;
  line-height: 1.5;
}

.form-divider {
  height: 1px;
  margin: 3px 0;
  background: var(--line);
}

.fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.choice-chip {
  position: relative;
}

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

.choice-chip span {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card-strong);
}

.choice-chip input:checked + span {
  color: var(--red);
  border-color: #efc0ba;
  background: var(--red-soft);
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 9px;
  margin-top: 20px;
}

.source-preview {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.source-preview summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.source-preview pre {
  overflow: auto;
  max-height: 240px;
  margin: 11px 0 0;
  color: #526168;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.analysis-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.analysis-score > strong {
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--teal);
  font-size: 22px;
  border: 7px solid var(--teal-soft);
  border-radius: 50%;
}

.analysis-score h3 {
  margin: 0;
  font-size: 15px;
}

.analysis-score p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 11px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  border-radius: 11px;
  background: var(--teal-soft);
}

.check-item.missing {
  color: #8d630f;
  background: var(--amber-soft);
}

.check-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  font-size: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.generated-copy {
  margin-top: 13px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.action-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.action-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-strong);
}

.action-row > span:first-child {
  display: grid;
  gap: 3px;
}

.action-row strong {
  font-size: 12px;
}

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

.action-row svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-row.danger strong {
  color: var(--red);
}

.action-row.erase-all {
  border-color: #edb9b1;
  background: var(--red-soft);
}

.action-row.erase-all strong {
  font-size: 13px;
}

.batch-select-all {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 3px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.batch-select-all input,
.batch-card > input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.batch-select-all small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.batch-list {
  display: grid;
  gap: 9px;
}

.batch-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-strong);
}

.batch-card:has(> input:checked) {
  border-color: #b8dcd3;
  box-shadow: 0 7px 18px rgba(22, 127, 114, 0.07);
}

.batch-card-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.batch-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.batch-card-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-card-company {
  overflow: hidden;
  color: #44555d;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-card-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-note {
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.phone-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
  padding: 13px;
  color: #526168;
  font-size: 11px;
  line-height: 1.6;
  border-radius: 14px;
  background: var(--blue-soft);
}

.phone-tip svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.install-app-btn {
  margin-top: 11px;
}

.install-app-btn:disabled {
  color: var(--teal);
  border: 1px solid #c8e4dd;
  background: var(--teal-soft);
  opacity: 1;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: calc(88px + var(--safe-bottom));
  left: 18px;
  width: fit-content;
  max-width: calc(100% - 36px);
  margin: 0 auto;
  padding: 11px 15px;
  color: white;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  border-radius: 12px;
  background: rgba(18, 43, 56, 0.96);
  box-shadow: 0 12px 30px rgba(18, 43, 56, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (min-width: 680px) {
  .main-content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.85fr);
    gap: 16px;
    align-items: start;
  }

  .home-layout .hero-card {
    min-height: 242px;
  }

  .home-layout .stats-block {
    margin-top: 0;
  }

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

  .card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bottom-nav {
    right: 50%;
    bottom: 14px;
    left: auto;
    width: 430px;
    min-height: 64px;
    padding: 5px;
    border: 1px solid rgba(222, 217, 207, 0.9);
    border-radius: 20px;
    transform: translateX(50%);
  }

  .nav-item {
    min-height: 52px;
  }

  .sheet-backdrop {
    align-items: center;
    padding: 34px 20px;
  }

  .sheet {
    max-height: min(840px, calc(100dvh - 68px));
    border-radius: 26px;
  }
}

@media (max-width: 370px) {
  .main-content {
    padding-right: 12px;
    padding-left: 12px;
  }

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

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

  .stat-grid {
    gap: 6px;
  }

  .stat-card {
    padding: 13px 10px;
  }

  .score-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
  }

  .score-ring {
    width: 74px;
    height: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
