:root {
    --main: #ff7a00;
    --main-dark: #d95f00;
    --soft: #fff3df;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #eceff3;
    --white: #fff;
    --shadow: 0 18px 45px rgba(31, 41, 55, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 122, 0, .12), transparent 30%),
        linear-gradient(180deg, #fffaf3 0%, #ffffff 58%, #fffaf3 100%);
    line-height: 1.75;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
img { max-width: 100%; }

.app-shell {
    width: min(100% - 32px, 1040px);
    margin-inline: auto;
    padding: 22px 0 34px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.22rem, 2.2vw, 1.6rem);
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--main), #ffae38);
    box-shadow: 0 12px 26px rgba(255, 122, 0, .22);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: .94rem;
}

.top-nav a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
}

.main-card,
.history-page,
.empty-card {
    border: 1px solid rgba(236, 239, 243, .95);
    border-radius: 28px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: clamp(22px, 4vw, 48px);
    align-items: center;
    padding: clamp(28px, 5vw, 52px) clamp(18px, 5vw, 56px) clamp(22px, 4vw, 42px);
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 185, 64, .32), transparent 32%),
        linear-gradient(180deg, #fff3df 0%, #fff 100%);
}

.hero-panel__text { min-width: 0; }
.hero-panel__visual {
    position: relative;
    display: grid;
    place-items: center;
}

.hero-panel__visual::before {
    content: "";
    position: absolute;
    width: min(100%, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 122, 0, .11);
    filter: blur(2px);
}

.hero-panel__visual img {
    position: relative;
    width: min(100%, 360px);
    filter: drop-shadow(0 22px 34px rgba(31, 41, 55, .12));
}

.eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 6px 13px;
    border-radius: 999px;
    color: var(--main-dark);
    background: #fff8ec;
    font-size: .88rem;
    font-weight: 900;
}

.hero-panel h1,
.history-page h1 {
    margin: 0;
    font-size: clamp(2.15rem, 6vw, 4.2rem);
    line-height: 1.14;
    letter-spacing: -.07em;
}

.lead,
.history-page__head p {
    max-width: 680px;
    margin: 18px 0 0;
    color: #334155;
    font-weight: 650;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 24px clamp(18px, 5vw, 56px) 34px;
}

.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }

label {
    display: block;
    margin-bottom: 6px;
    color: #4b5563;
    font-weight: 850;
    font-size: .92rem;
}

input, select {
    width: 100%;
    min-height: 52px;
    border: 1px solid #dce3ec;
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--main);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, .13);
}

.field-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

.stars {
    letter-spacing: 1px;
    color: #f59e0b;
    white-space: nowrap;
}

.search-button {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--main), #ff9b25);
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(255, 122, 0, .25);
}

.search-button:disabled { opacity: .68; cursor: wait; }

.note {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
}

.message {
    margin: 18px clamp(18px, 5vw, 56px) 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff3df;
    color: #7a4a00;
    font-weight: 800;
}

.message--error {
    grid-column: 1 / -1;
    margin: 0;
    background: #fff0f0;
    color: #a40000;
}

.history-page {
    padding: clamp(24px, 5vw, 48px);
}

.history-page__head {
    margin-bottom: 24px;
}

.history-page h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.history-empty-card {
    padding: 34px 24px;
    text-align: center;
    box-shadow: none;
}

.history-empty-card h2 {
    margin: 0 0 8px;
}

.history-empty-card p {
    margin: 0 auto 18px;
    max-width: 560px;
    color: var(--muted);
}

.history-back-button {
    width: fit-content;
    margin-inline: auto;
    padding-inline: 24px;
}

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

.history-list--page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.history-item--large {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 12px;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(31, 41, 55, .08);
}

.history-item img,
.history-thumb {
    width: 82px;
    height: 82px;
    border-radius: 14px;
    object-fit: cover;
    background: #f3f4f6;
}

.history-item--large img,
.history-item--large .history-thumb {
    width: 96px;
    height: 96px;
}

.history-thumb {
    display: grid;
    place-items: center;
    font-size: 1.65rem;
}

.history-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 950;
}

.history-meta,
.history-date {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 4px 0;
    color: var(--muted);
    font-size: .84rem;
}

@media (max-width: 860px) {
    .hero-panel { grid-template-columns: 1fr; text-align: center; }
    .lead, .history-page__head p { margin-inline: auto; }
    .hero-panel__visual img { width: min(78%, 310px); }
}

@media (max-width: 720px) {
    .app-shell { width: min(100% - 22px, 1040px); }
    .app-header { align-items: flex-start; flex-direction: column; }
    .search-form,
    .history-list,
    .history-list--page { grid-template-columns: 1fr; }
}

/* SEO content blocks */
.seo-section {
    padding: clamp(28px, 5vw, 52px) clamp(18px, 5vw, 56px) clamp(34px, 5vw, 60px);
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fffaf3);
}

.seo-section h2 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 3.8vw, 2.5rem);
    line-height: 1.3;
    letter-spacing: -.04em;
}

.seo-section > p {
    max-width: 820px;
    margin: 0 0 22px;
    color: #334155;
    font-weight: 620;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.seo-grid article {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 41, 55, .05);
}

.seo-grid h3 {
    margin: 0 0 8px;
    font-size: 1.04rem;
}

.seo-grid p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

.area-links {
    margin-top: 28px;
    padding: 20px;
    border-radius: 22px;
    background: #fff7ec;
    border: 1px solid #ffe2bd;
}

.area-links h3 {
    margin: 0 0 12px;
}

.area-links div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.area-links a,
.area-links span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #f3dcc2;
    font-weight: 850;
    color: #7a4a00;
}

.faq-block {
    margin-top: 28px;
}

.faq-block h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.faq-block details {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 14px 16px;
    margin-top: 10px;
}

.faq-block summary {
    cursor: pointer;
    font-weight: 900;
}

.faq-block p {
    margin: 10px 0 0;
    color: var(--muted);
}

.area-page .area-hero {
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 185, 64, .32), transparent 32%),
        linear-gradient(180deg, #fff3df 0%, #fff 100%);
}

.area-cta {
    width: fit-content;
    min-height: 52px;
    margin-top: 22px;
    padding: 0 24px;
}

.area-content {
    padding-top: clamp(28px, 5vw, 54px);
}

.area-keywords span {
    color: #374151;
}

@media (max-width: 860px) {
    .seo-grid { grid-template-columns: 1fr; }
    .area-cta { margin-inline: auto; }
}
