@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Manrope:wght@400;500;600;700&family=Playfair+Display:ital,wght@1,500&display=swap");

:root {
  --ink: #17221e;
  --muted: #6d7772;
  --paper: #f3f1ea;
  --panel: #fbfaf6;
  --line: #d9d8d0;
  --green: #285e48;
  --lime: #b9d98b;
  --pale: #e7eedc;
  --white: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 5%, rgba(185, 217, 139, .35), transparent 24rem),
    var(--paper);
  font-family: "Manrope", sans-serif;
  min-height: 100vh;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 80px);
  border-bottom: 1px solid rgba(23, 34, 30, .12);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 32px; aspect-ratio: 1; color: var(--paper); background: var(--ink); border-radius: 50%; font-family: "Playfair Display", serif; font-style: italic; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.status-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); font: 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.account-button { padding: 8px 13px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: white; cursor: pointer; font: 11px "DM Mono", monospace; }
.notification-button { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); cursor: pointer; }
.notification-button span { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--green); color: white; font: 9px "DM Mono", monospace; }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4e946e; box-shadow: 0 0 0 4px rgba(78,148,110,.12); animation: breathe 2s infinite; }
.notification-panel { position: fixed; z-index: 20; top: 68px; right: clamp(16px, 5vw, 80px); width: min(410px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 90px)); overflow: auto; padding: 25px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 24px 80px rgba(15, 24, 20, .2); }
.notification-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.notification-heading h2 { font-size: 25px; }
.notification-list { display: grid; }
.notification-item { padding: 17px 0; border-bottom: 1px solid var(--line); }
.notification-item.unread::before { content: ""; float: left; width: 7px; height: 7px; margin: 7px 10px 0 0; border-radius: 50%; background: var(--green); }
.notification-item strong, .notification-item small { display: block; }
.notification-item strong { font-size: 13px; }
.notification-item p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.notification-item small { color: var(--muted); font: 9px "DM Mono", monospace; }
.notification-empty { padding: 28px 0 8px; color: var(--muted); font-size: 12px; text-align: center; }

main { max-width: 1500px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 80px) 80px; }
.hero { padding: clamp(60px, 10vw, 130px) 0 clamp(50px, 8vw, 100px); max-width: 900px; }
.eyebrow, .step { margin: 0 0 18px; color: var(--green); font: 500 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(52px, 8.2vw, 118px); line-height: .92; letter-spacing: -.07em; font-weight: 500; }
h1 em { color: var(--green); font-family: "Playfair Display", serif; font-weight: 500; letter-spacing: -.045em; }
.intro { max-width: 580px; margin: 36px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; }

.search-history { display: grid; grid-template-columns: 230px 1fr; gap: 35px; align-items: start; margin-bottom: 18px; padding: 26px; border: 1px solid var(--line); background: rgba(251, 250, 246, .72); }
.search-history h2 { font-size: 24px; }
.history-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.history-card { position: relative; flex: 0 0 auto; }
.history-item { width: 220px; padding: 13px 38px 13px 15px; border: 1px solid var(--line); background: var(--white); cursor: pointer; text-align: left; transition: .2s; }
.history-item:hover, .history-item.active { border-color: var(--green); background: var(--pale); }
.history-item strong, .history-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item strong { font-size: 13px; }
.history-item small { margin-top: 5px; color: var(--muted); font: 9px "DM Mono", monospace; text-transform: uppercase; }
.history-remove { position: absolute; top: 9px; right: 8px; width: 25px; height: 25px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.history-remove:hover { background: #f0dcd6; color: #8b352b; }

.workspace { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(560px, 1.3fr); min-height: 760px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 24px 80px rgba(34, 47, 40, .08); }
.config-panel { padding: clamp(28px, 4vw, 54px); border-right: 1px solid var(--line); }
.results-panel { padding: clamp(28px, 4vw, 54px); min-width: 0; }
.panel-heading, .progress-header, .results-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
h2 { margin: 0; font-size: clamp(25px, 2.5vw, 36px); line-height: 1.1; letter-spacing: -.045em; }
.text-button { padding: 4px 0; border: 0; border-bottom: 1px solid; background: transparent; color: var(--green); cursor: pointer; font-size: 12px; }

.config-panel > label, fieldset, .form-row { display: block; margin-top: 36px; }
label > span, legend { display: block; margin-bottom: 10px; color: var(--muted); font: 500 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
fieldset { padding: 0; border: 0; }
input, select {
  width: 100%;
  padding: 13px 0;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid #bfc2b9;
  outline: none;
  background: transparent;
  transition: border .2s;
}
input:focus, select:focus { border-color: var(--green); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chip span { display: block; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); cursor: pointer; font: 12px "Manrope", sans-serif; text-transform: none; letter-spacing: 0; transition: .2s; }
.chip input:checked + span { border-color: var(--green); background: var(--pale); color: var(--green); }
.form-row { display: grid !important; gap: 20px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-row.two { grid-template-columns: repeat(2, 1fr); }
.advanced-fields { padding-top: 1px; }
.advanced-fields .form-row { margin-top: 22px; }

.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 28px;
  border: 1px solid var(--ink); cursor: pointer; text-decoration: none; transition: .2s;
}
.primary-button { width: 100%; justify-content: space-between; margin-top: 42px; padding: 17px 20px; background: var(--ink); color: white; }
.primary-button:hover { background: var(--green); border-color: var(--green); }
.primary-button:disabled { opacity: .5; cursor: wait; }
.secondary-button { padding: 9px 13px; background: transparent; color: var(--ink); font-size: 11px; }
.secondary-button:hover { background: var(--ink); color: white; }
.secondary-button.disabled { pointer-events: none; opacity: .3; }
.danger-button { border-color: #b7867d; color: #8b352b; }
.danger-button:hover { border-color: #8b352b; background: #8b352b; }
.fine-print { color: var(--muted); font: 10px/1.5 "DM Mono", monospace; }

.empty-state { height: 100%; min-height: 620px; display: flex; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
.empty-state h2 { max-width: 440px; }
.empty-state > p:last-child { max-width: 480px; color: var(--muted); line-height: 1.6; }
.orbital { position: relative; display: grid; place-items: center; width: 170px; aspect-ratio: 1; margin-bottom: 54px; border: 1px solid var(--line); border-radius: 50%; }
.orbital::before, .orbital::after { content: ""; position: absolute; inset: 20px; border: 1px solid var(--line); border-radius: 50%; }
.orbital::after { inset: 48px; background: var(--ink); }
.orbital b { z-index: 1; color: var(--paper); font: italic 32px "Playfair Display", serif; }
.orbital span { position: absolute; z-index: 2; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.orbital span:nth-child(1) { top: 17px; left: 76px; }
.orbital span:nth-child(2) { right: 28px; bottom: 35px; }
.orbital span:nth-child(3) { left: 42px; bottom: 17px; }

.actions { display: flex; align-items: center; gap: 8px; }
.actions select { width: auto; padding: 9px 28px 9px 10px; border: 1px solid var(--line); font-size: 11px; }
.meter { height: 2px; margin-top: 40px; overflow: hidden; background: var(--line); }
.meter span { display: block; width: 0; height: 100%; background: var(--green); transition: width .5s; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stats div { padding: 25px 14px 25px 0; border-right: 1px solid var(--line); }
.stats div:not(:first-child) { padding-left: 18px; }
.stats div:last-child { border-right: 0; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: clamp(20px, 2.5vw, 31px); font-weight: 500; letter-spacing: -.05em; }
.stats span { margin-top: 5px; color: var(--muted); font: 9px "DM Mono", monospace; text-transform: uppercase; }
.provider-line { display: flex; align-items: center; gap: 10px; padding: 14px 0; color: var(--muted); font: 10px "DM Mono", monospace; border-bottom: 1px solid var(--line); }
.provider-line strong { color: var(--green); font-weight: 500; }
.spacer { flex: 1; }
.results-toolbar { align-items: flex-end; margin-top: 56px; margin-bottom: 20px; }

.result-list { display: grid; gap: 9px; }
.result-card { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--white); animation: reveal .45s ease both; transition: border .2s, transform .2s; }
.result-card:hover { border-color: #9aa79f; transform: translateY(-1px); }
.result-card.rejected { display: none; }
.result-main { min-width: 0; flex: 1; display: grid; grid-template-columns: 34px minmax(130px, 1fr) minmax(100px, .8fr) 58px; align-items: center; gap: 10px; padding: 18px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.rank { color: #9a9f9b; font: 11px "DM Mono", monospace; }
.candidate-identity strong, .candidate-identity small { display: block; }
.candidate-name { font-size: 20px; letter-spacing: -.035em; }
.candidate-domain, .pronunciation { margin-top: 2px; color: var(--muted); font: 10px "DM Mono", monospace; }
.score-ring { display: grid; grid-template-columns: auto auto; align-items: baseline; justify-content: end; color: var(--green); }
.score-ring b { font-size: 21px; font-weight: 600; }
.score-ring small { font: 8px "DM Mono", monospace; }
.card-actions { display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 0; }
.availability-badge { padding: 6px 8px; border-radius: 99px; color: var(--green); background: var(--pale); font: 8px "DM Mono", monospace; text-transform: uppercase; white-space: nowrap; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover, .icon-button.active { color: white; background: var(--green); border-color: var(--green); }
.waiting-result { display: flex; align-items: center; gap: 12px; padding: 25px 0; color: var(--muted); font: 11px "DM Mono", monospace; }
.waiting-result span { width: 14px; height: 14px; border: 1px solid var(--green); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }

dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: clamp(26px, 5vw, 54px); border: 0; color: var(--ink); background: var(--panel); box-shadow: 0 25px 100px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(15, 24, 20, .65); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.detail-name { margin: 0; font-size: clamp(44px, 8vw, 72px); letter-spacing: -.06em; }
.detail-domain { color: var(--green); font: 13px "DM Mono", monospace; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; margin-top: 34px; padding-top: 25px; border-top: 1px solid var(--line); }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; color: var(--muted); font-size: 11px; }
.score-row .bar { grid-column: 1 / -1; height: 3px; background: var(--line); }
.score-row .bar i { display: block; height: 100%; background: var(--green); }
.detail-note { margin-top: 30px; padding: 15px; background: var(--pale); color: var(--green); font-size: 12px; line-height: 1.5; }

.auth-dialog { width: min(500px, calc(100vw - 32px)); padding: clamp(30px, 6vw, 62px); }
.auth-dialog::backdrop { background: rgba(15, 24, 20, .84); backdrop-filter: blur(10px); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 56px; font-weight: 700; }
.auth-intro { margin: 17px 0 34px; color: var(--muted); line-height: 1.6; }
.auth-form label { display: block; margin-top: 22px; }
.auth-form .primary-button { margin-top: 34px; }
.auth-error { min-height: 18px; margin: 18px 0 0; color: #9d3c32; font: 11px "DM Mono", monospace; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .45; transform: scale(.8); } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
  .search-history { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .config-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .empty-state { min-height: 500px; }
}
@media (max-width: 620px) {
  .site-header { padding: 0 20px; }
  .status-pill { font-size: 0; }
  main { padding-inline: 12px; }
  .hero { padding-inline: 8px; }
  .workspace { margin: 0; }
  .form-row.two { grid-template-columns: 1fr; }
  .stats strong { font-size: 18px; }
  .stats span { font-size: 7px; }
  .result-main { grid-template-columns: 25px 1fr 48px; }
  .pronunciation { display: none; }
  .availability-badge { display: none; }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
}
