:root {
  --bg: #f7f5ef;
  --paper: #fffdf8;
  --ink: #171713;
  --muted: #77746b;
  --line: #dedbd2;
  --soft: #ece9df;
  --accent: #171713;
  --radius: 22px;
  --shadow: 0 14px 44px rgba(25, 23, 18, .08);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 18% 0%, rgba(255,255,255,.85), transparent 34rem), var(--bg); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(820px, 100%); margin: 0 auto; padding: max(36px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom)); }
.hero { min-height: 48vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; transition: min-height .35s ease; }
.hero.has-results { min-height: 0; padding-top: 10px; justify-content: flex-start; }
.brand-wrap { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 56px; height: 56px; border: 1.5px solid var(--ink); border-radius: 18px; display: grid; place-items: center; font-size: 26px; font-weight: 800; letter-spacing: -.08em; background: rgba(255,255,255,.52); }
h1 { margin: 0; font-size: clamp(30px, 7vw, 48px); letter-spacing: -.055em; line-height: 1; }
.brand-wrap p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-box { min-width: 0; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 18px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 20px rgba(26,24,18,.04); }
.search-box > span { font-size: 22px; transform: translateY(-1px); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: #aaa69b; }
.clear-btn { border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; }
.primary-btn, .random-btn, .ghost-btn { border-radius: 18px; padding: 0 22px; height: 58px; cursor: pointer; font-weight: 750; letter-spacing: .02em; }
.primary-btn { border: 1.5px solid var(--ink); background: var(--ink); color: white; }
.secondary-actions { display: flex; gap: 10px; align-items: center; }
.random-btn { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); min-width: 138px; }
.random-btn span { margin-right: 7px; }
.ghost-btn { border: 1px solid var(--line); background: rgba(255,255,255,.48); color: var(--ink); height: 42px; border-radius: 14px; padding: 0 16px; }
.microcopy { margin: -8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.status { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; background: rgba(255,255,255,.55); color: var(--muted); font-size: 13px; }
.status.loading::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 9px; border: 1.5px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.results-section, .saved-section { padding-top: 10px; }
.results-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin-bottom: 5px; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); font-size: 22px; cursor: pointer; }
.cards { display: grid; gap: 12px; }
.deal-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.deal-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(135deg, rgba(255,255,255,.45), transparent 40%); }
.card-topline, .meta-row, .source-row, .card-actions { position: relative; z-index: 1; }
.card-topline { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kind-badge, .score-badge { font-size: 11px; line-height: 1; padding: 7px 9px; border-radius: 999px; border: 1px solid var(--line); font-weight: 800; letter-spacing: .05em; }
.kind-badge { background: var(--ink); color: white; border-color: var(--ink); }
.score-badge { background: var(--soft); color: var(--ink); }
.deal-title { position: relative; z-index: 1; margin: 17px 0 9px; font-size: 20px; line-height: 1.35; letter-spacing: -.025em; }
.deal-summary { position: relative; z-index: 1; margin: 0; color: #4f4c45; line-height: 1.68; font-size: 14px; }
.meta-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.deadline, .condition { color: var(--muted); background: #f3f0e8; border-radius: 9px; padding: 6px 8px; font-size: 11px; }
.source-row { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 7px; }
.source-link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 700; }
.source-link:hover { opacity: .6; }
.card-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 18px; }
.action-btn { min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; font-weight: 700; }
.action-btn.active { background: var(--ink); color: white; border-color: var(--ink); }
.save-btn { min-width: 112px; padding-inline: 18px; }
.saved-section { margin-top: 28px; }
footer { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.footer-btn, .footer-link { border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 8px 0; font-size: 12px; }
.footer-btn { font-weight: 800; }
.footer-btn span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 5px; border-radius: 999px; background: var(--ink); color: white; }
.footer-link { color: var(--muted); }
.empty { border: 1px dashed var(--line); border-radius: 18px; padding: 26px; color: var(--muted); text-align: center; line-height: 1.7; }
.demo-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
@media (max-width: 620px) {
  .app-shell { padding-inline: 16px; }
  .hero { min-height: 55vh; }
  .search-row { grid-template-columns: 1fr; }
  .primary-btn { height: 50px; }
  .secondary-actions { align-items: stretch; }
  .random-btn { flex: 1; height: 50px; }
  .card-actions { justify-content: stretch; }
  .save-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.footer-left { display: flex; align-items: center; gap: 18px; }
.key-status.configured { color: var(--ink); font-weight: 800; }
.key-dialog { width: min(560px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 24px; background: transparent; color: var(--ink); }
.key-dialog::backdrop { background: rgba(20, 19, 16, .42); backdrop-filter: blur(3px); }
.key-panel { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 24px 80px rgba(20,19,16,.22); }
.key-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.key-copy { margin: 18px 0; color: #4f4c45; font-size: 13px; line-height: 1.75; }
.key-input-wrap { display: block; }
.key-input-wrap > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.key-input-wrap input { width: 100%; height: 54px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 15px; outline: 0; background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.key-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 12px; }
.key-actions .primary-btn, .key-actions .ghost-btn { height: 50px; }
@media (max-width: 620px) {
  .key-actions { grid-template-columns: 1fr; }
  footer { align-items: flex-end; }
  .footer-left { gap: 14px; }
}


/* v0.1.2 location */
.location-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.location-btn span { margin-right: 5px; }
.location-status { margin-top: -10px; width: fit-content; max-width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--muted); font-size: 11px; line-height: 1.35; }
.location-status strong { color: var(--ink); }
.area { color: var(--muted); background: #f3f0e8; border-radius: 9px; padding: 6px 8px; font-size: 11px; }
@media (max-width: 620px) {
  .secondary-actions { flex-wrap: wrap; }
  .location-btn { flex: 1; min-width: 138px; height: 50px; }
  #forYouBtn { flex: 1 0 100%; }
}
.osm-credit { margin-left: 5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
