:root {

    --safe: #2ecc71;

    --caution: #f5a623;

    --danger: #e74c3c;

    --high: #e74c3c;

    --mid: #f5a623;

    --low: #8fa0b3;

    --ink: #24303d;

    --ink-dim: #8592a3;

    --line: #e7ebf0;

    --panel: #ffffff;

    --bg: #f4f6f9;

    --accent: #2f6fed;

    --accent-dark: #1f4fbf;

    --header-grad: linear-gradient(135deg, #1a5f7a 0%, #2f6fed 100%);

    --content-max: 640px;

}

* { box-sizing: border-box; }

html {

    overflow-y: scroll;

}

html, body {

    margin: 0;

    min-height: 100%;

    background: var(--bg);

    font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;

    color: var(--ink);

}

.screen { display: none; flex-direction: column; min-height: 100vh; }

.screen.active { display: flex; }

.top-header {

    display: flex; align-items: center; gap: 10px;

    padding: 18px 20px;

    background: var(--panel);

    border-bottom: 1px solid var(--line);

}

.top-header h2 { margin: 0; font-size: 16px; flex: 1; text-align: center; }

.top-header:has(.back-btn) h2 { margin-right: 28px; }

.back-btn {

    background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink);

    width: 28px;

}

.home-hero {

    background: var(--header-grad);

    color: white;

    padding: 32px 20px 26px;

    text-align: center;

}

.home-hero .logo-badge {

    width: 46px; height: 46px; border-radius: 12px;

    background: rgba(255,255,255,0.18);

    display: inline-flex; align-items: center; justify-content: center;

    font-size: 22px; margin-bottom: 8px;

}

.home-hero h1 { margin: 4px 0 4px; font-size: 20px; }

.home-hero p { margin: 0; font-size: 12px; opacity: 0.85; }

.type-buttons { display: flex; gap: 10px; padding: 16px 20px; margin-top: -14px; }

.type-btn {

    flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;

    padding: 14px 6px; text-align: center; cursor: pointer;

    box-shadow: 0 6px 16px rgba(20,30,45,0.08);

}

.type-btn .icon { font-size: 20px; display: block; margin-bottom: 6px; }

.type-btn span.label { font-size: 12px; color: var(--ink); }

.content-check-btn { padding: 20px 16px; }

.content-check-btn .icon { font-size: 28px; }

.content-check-btn span.label { display: block; font-size: 16px; font-weight: 700; margin-bottom: 6px; }

.content-check-btn .description { display: block; font-size: 12px; color: var(--ink-dim); }

.section-title { padding: 4px 20px; font-size: 14px; font-weight: 700; margin-top: 8px; }

.history-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }

.history-item {

    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;

    padding: 12px 14px;

}

.history-item .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }

.history-item .row1-left { display: flex; align-items: center; gap: 8px; }

.history-item .date { font-size: 11px; color: var(--ink-dim); }

.history-delete-btn {

    border: none; background: none; cursor: pointer; color: var(--ink-dim);

    font-size: 15px; padding: 4px 6px; line-height: 1; border-radius: 6px;

    flex-shrink: 0;

}

.history-delete-btn:hover { color: var(--danger); background: rgba(231,76,60,0.08); }

.history-item .snippet { font-size: 13px; color: var(--ink); line-height: 1.5;

    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty-hint { padding: 30px 20px; text-align: center; color: var(--ink-dim); font-size: 13px; }

.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: white; }

.badge.safe { background: var(--safe); }

.badge.caution { background: var(--caution); }

.badge.danger { background: var(--danger); }

.bottom-nav {

    display: flex; border-top: 1px solid var(--line); background: var(--panel);

    padding: 8px 0 12px;

    position: sticky; bottom: 0;

}

.nav-item {

    flex: 1; text-align: center; background: none; border: none; cursor: pointer;

    color: var(--ink-dim); font-size: 10px; display: flex; flex-direction: column; gap: 2px; align-items: center;

}

.nav-item .nav-icon { font-size: 18px; }

.nav-item.active { color: var(--accent); }

.check-body { padding: 16px 20px; flex: 1; }

textarea#post-text {

    width: 100%; min-height: 280px; resize: vertical;

    border: 1px solid var(--line); border-radius: 12px; padding: 14px;

    font-size: 14px; line-height: 1.7; font-family: inherit;

}

.char-count { text-align: right; font-size: 11px; color: var(--ink-dim); margin-top: 4px; }

.attach-row { display: flex; gap: 10px; margin-top: 16px; }

.attach-btn {

    flex: 1; border: 1px solid var(--line); background: var(--panel); border-radius: 10px;

    padding: 10px; font-size: 13px; cursor: pointer; color: var(--ink);

}

.image-preview-wrap { display: none; align-items: center; gap: 10px; margin-top: 10px; }

.image-preview-wrap img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.image-preview-wrap button { border: none; background: var(--line); border-radius: 999px; width: 22px; height: 22px; cursor: pointer; }

.platform-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.platform-chip {

    border: 1px solid var(--line); background: var(--panel); border-radius: 999px;

    padding: 7px 16px; font-size: 12px; cursor: pointer; color: var(--ink);

}

.platform-chip.selected { background: var(--accent); border-color: var(--accent); color: white; }

.platform-chip.static { cursor: default; }

.primary-btn {

    width: calc(100% - 40px); margin: 14px 20px; padding: 13px;

    background: var(--accent); color: white; border: none; border-radius: 12px;

    font-size: 15px; font-weight: 700; cursor: pointer;

}

.primary-btn:disabled { opacity: 0.45; cursor: default; }

.secondary-btn {

    width: calc(100% - 40px); margin: 0 20px 16px; padding: 12px;

    background: transparent; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 12px;

    font-size: 14px; cursor: pointer;

}

.platform-block {

    width: calc(100% - 40px); margin: 0 20px 16px;

    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;

    padding: 14px 16px;

}

.platform-block .text-box-label { margin-bottom: 10px; }

.analyzing-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 24px; }

.pulse-icon {

    width: 76px; height: 76px; border-radius: 50%; background: #eaf1ff;

    display: flex; align-items: center; justify-content: center; font-size: 30px;

    margin-bottom: 18px; animation: pulse 1.4s ease-in-out infinite;

}

@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.analyzing-body h3 { margin: 0 0 4px; font-size: 18px; }

.analyzing-body .sub { color: var(--ink-dim); font-size: 12px; margin-bottom: 26px; }

.check-list { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 14px; }

.check-list .item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-dim); }

.check-list .item .mark { width: 20px; text-align: center; }

.check-list .item.done { color: var(--ink); }

.check-list .item.done .mark { color: var(--safe); }

.check-list .item.active .mark { color: var(--accent); }

.analyzing-footer { margin-top: auto; padding: 20px; text-align: center; font-size: 11px; color: var(--ink-dim); }

.result-body { padding: 20px; flex: 1; }

.gauge-card { text-align: center; padding: 14px 0 10px; }

#gauge-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 10px; }

#gauge-wrap svg { transform: rotate(-90deg); }

#gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

#gauge-center .g-label { font-size: 11px; color: var(--ink-dim); }

#gauge-center .g-score { font-size: 30px; font-weight: 800; }

#gauge-center .g-badge { margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; color: white; }

.result-summary { text-align: center; font-size: 13px; color: var(--ink-dim); margin: 4px 0 20px; }

.level-legend { display: flex; gap: 6px; margin: 0 0 20px; }

.legend-seg {

    flex: 1; border-radius: 10px; padding: 10px 6px; text-align: center; color: white;

    font-size: 11px; font-weight: 700; opacity: 0.55; transform: scale(0.96);

    transition: opacity 0.2s, transform 0.2s;

}

.legend-seg .pct { display: block; font-size: 10px; font-weight: 400; opacity: 0.9; margin-top: 2px; }

.legend-seg.safe { background: var(--safe); }

.legend-seg.caution { background: var(--caution); }

.legend-seg.danger { background: var(--danger); }

.legend-seg.current { opacity: 1; transform: scale(1.05); box-shadow: 0 4px 12px rgba(20,30,45,0.18); }

.issue-card {

    background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--mid);

    border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;

}

.issue-card .issue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

.issue-card .issue-label { font-weight: 700; font-size: 13px; }

.issue-card .issue-desc { font-size: 12px; color: var(--ink-dim); line-height: 1.5; }

.sev-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: white; }

.sev-high { background: var(--high); }

.sev-mid { background: var(--mid); }

.sev-low { background: var(--low); }

.improve-body { padding: 20px; flex: 1; }

.text-box-label { font-size: 12px; font-weight: 700; color: var(--ink-dim); margin-bottom: 6px; }

.text-box {

    border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;

    font-size: 13px; line-height: 1.7; white-space: pre-wrap; margin-bottom: 18px;

}

.text-box.original { background: #f7f8fa; }

.text-box.improved { background: #eefaf1; border-color: #bfe8c9; color: #1c5c33; }

.suggestion-item { display: flex; gap: 8px; font-size: 13px; margin-bottom: 8px; align-items: flex-start; }

.suggestion-item .chk { color: var(--safe); }

.settings-body { padding: 8px 0 20px; flex: 1; }

.settings-block { background: var(--panel); margin: 0 20px 16px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }

.settings-row { padding: 14px 16px; border-bottom: 1px solid var(--line); }

.settings-row:last-child { border-bottom: none; }

.settings-row .row-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.settings-row .row-desc { font-size: 11px; color: var(--ink-dim); margin-top: 4px; }

input[type="range"] { width: 100%; }

.sens-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-dim); margin-top: 2px; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; }

.switch { position: relative; width: 40px; height: 22px; }

.switch input { display: none; }

.slider-toggle {

    position: absolute; inset: 0; background: #ccc; border-radius: 999px; cursor: pointer; transition: 0.2s;

}

.slider-toggle::before {

    content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;

    background: white; border-radius: 50%; transition: 0.2s;

}

input:checked + .slider-toggle { background: var(--accent); }

input:checked + .slider-toggle::before { transform: translateX(18px); }

.link-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }

.link-row:last-child { border-bottom: none; }

.link-row .arrow { color: var(--ink-dim); }

.version-text { text-align: center; font-size: 11px; color: var(--ink-dim); margin-top: 6px; }

.guide-body { padding: 16px 20px 28px; flex: 1; }

.guide-intro {

    text-align: center; background: var(--header-grad); color: white;

    border-radius: 16px; padding: 26px 18px; margin-bottom: 20px;

}

.guide-icon-badge {

    width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,0.18);

    display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px;

}

.guide-intro h3 { margin: 4px 0 6px; font-size: 17px; }

.guide-intro p { margin: 0; font-size: 12px; opacity: 0.9; }

.feature-grid { display: flex; gap: 8px; margin: 10px 0 20px; }

.feature-item {

    flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;

    padding: 12px 4px; text-align: center; font-size: 10px; color: var(--ink-dim); line-height: 1.4;

}

.feature-item .feature-icon { display: block; font-size: 18px; margin-bottom: 6px; }

.guide-step {

    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;

    padding: 14px 16px; margin-bottom: 12px;

}

.step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.step-num {

    width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: white;

    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;

}

.step-title { font-size: 14px; font-weight: 700; }

.step-list { margin: 0; padding-left: 20px; }

.step-list li { font-size: 12px; color: var(--ink-dim); line-height: 1.7; }

.guide-tip {

    background: #fff8ec; border: 1px solid #f4ddb0; border-radius: 12px;

    padding: 14px 16px; margin: 4px 0 20px;

}

.tip-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }

.tip-body { font-size: 12px; color: var(--ink-dim); line-height: 1.6; }

.usecase-item {

    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;

    padding: 10px 14px; font-size: 12px; margin-bottom: 8px;

}

.guide-footer {

    text-align: center; font-size: 12px; font-weight: 700; color: var(--accent);

    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);

}

.toast {

    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);

    background: rgba(30,30,30,0.9); color: white; padding: 8px 18px; border-radius: 999px;

    font-size: 12px; display: none; z-index: 50;

}

@media (min-width: 768px) {

    .top-header,

    .home-hero,

    .type-buttons,

    .section-title,

    .history-list,

    .check-body,

    .result-body,

    .improve-body,

    .settings-body,

    .settings-block,

    .guide-body,

    .privacy-policy-body,

    .analyzing-body,

    .primary-btn,

    .secondary-btn,

    .platform-block {

        max-width: var(--content-max);

        margin-left: auto;

        margin-right: auto;

        width: 100%;

    }

    .top-header { padding: 20px 0; }

    .home-hero { padding: 56px 0 40px; border-radius: 0 0 20px 20px; }

    .type-buttons { padding: 16px 0; }

    .section-title { padding: 4px 0; margin-top: 16px; }

    .history-list { padding: 0 0 20px; }

    .check-body, .result-body, .improve-body, .guide-body { padding: 32px 0; }

    .settings-block { margin: 0 auto 16px; }

    .primary-btn { margin: 14px auto; width: 100%; }

    .secondary-btn { margin: 0 auto 16px; width: 100%; }

    .platform-block { margin: 0 auto 16px; width: 100%; }

    .bottom-nav { display: none; }

    .top-header { position: relative; }

}

@media (min-width: 1200px) {

    :root { --content-max: 760px; }

}

.pc-nav { display: none; }

@media (min-width: 768px) {

    .pc-nav {

        display: flex; gap: 24px; justify-content: center;

        padding: 14px 0; background: var(--panel); border-bottom: 1px solid var(--line);

    }

    .pc-nav button {

        background: none; border: none; cursor: pointer; font-size: 13px; color: var(--ink-dim);

        padding: 6px 4px; border-bottom: 2px solid transparent;

        width: 64px;

        text-align: center;

    }

    .pc-nav button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

}

/* ============ アプリへのご要望(アンケート)画面 ============ */

.feedback-body { padding: 16px 20px 28px; flex: 1; }

.feedback-intro {

    display: flex; align-items: center; gap: 12px;

    background: var(--header-grad); color: white;

    border-radius: 16px; padding: 20px 18px; margin-bottom: 20px;

}

.feedback-intro-text { flex: 1; }

.feedback-intro-text h3 { margin: 0 0 8px; font-size: 16px; }

.feedback-intro-text p { margin: 0; font-size: 12px; line-height: 1.6; opacity: 0.9; }

.feedback-intro-icon { font-size: 40px; flex-shrink: 0; }

.feedback-question {

    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;

    padding: 16px; margin-bottom: 14px;

}

.q-title { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }

.q-title .q-text { flex: 1; }

.required-badge {

    flex-shrink: 0; color: #e74c3c; font-size: 11px; font-weight: 700;

    background: rgba(231, 76, 60, 0.1); border-radius: 6px; padding: 2px 7px;

    line-height: 1.6;

}

.feedback-error {

    display: none; color: #e74c3c; font-size: 12px; font-weight: 600; margin-top: 8px;

}

.q-num {

    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: white;

    font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;

}

.radio-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }

.radio-option { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); cursor: pointer; }

.radio-option input { accent-color: var(--accent); }

.radio-row-5 { justify-content: space-between; gap: 6px; }

.radio-row-5 .radio-option { flex-direction: column; text-align: center; gap: 4px; flex: 1; font-size: 10px; line-height: 1.3; }

.star-rating { display: flex; justify-content: center; gap: 8px; font-size: 28px; color: var(--line); cursor: pointer; margin: 6px 0 4px; user-select: none; }

.star-rating .star.active { color: #f5a623; }

.star-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-dim); }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; }

.checkbox-option { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); cursor: pointer; width: 44%; }

.checkbox-option input { accent-color: var(--accent); }

.feedback-other-input {

    width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;

    font-size: 12px; font-family: inherit;

}

.feedback-textarea {

    width: 100%; min-height: 70px; resize: vertical; border: 1px solid var(--line); border-radius: 10px;

    padding: 12px; font-size: 13px; line-height: 1.6; font-family: inherit;

}

.feedback-submit-btn { display: flex; align-items: center; justify-content: center; gap: 6px; }

.feedback-footer-note { text-align: center; font-size: 12px; color: var(--ink-dim); margin-top: 12px; }

@media (min-width: 768px) {

    .feedback-body { max-width: var(--content-max); margin-left: auto; margin-right: auto; width: 100%; padding: 32px 0; }

}

/* ============ 履歴画面 ============ */

/* 履歴タイトル */

.history-title-header {

    display: flex;

    justify-content: center;

    align-items: center;

}

.history-title-header h2 {

    text-align: center;

    margin: 0;

}

/* 一括削除ボタン */

.history-actions {

    width: 100%;

    padding: 16px 20px 8px;

    display: flex;

    justify-content: flex-end;

}

/* PC表示 */

@media (min-width: 768px) {

    .history-actions {

        max-width: var(--content-max);

        margin-left: auto;

        margin-right: auto;

        padding: 16px 0 8px;

    }

}

/* ============ プライバシーポリシー画面 ============ */
/*.privacy-policy-body { padding: 8px 0 20px; flex: 1; }*/
.privacy-policy-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.privacy-policy-body {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 12px;
}
.privacy-policy-num {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: white;
    font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.privacy-policy-row { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 14px; }

/* ============ 利用規約画面 ============ */
.terms-body { padding: 16px 20px 32px; flex: 1; font-size: 13px; line-height: 1.8; color: var(--ink); overflow-y: auto; }
.terms-updated { font-size: 11px; color: var(--ink-dim); margin: 0 0 16px; }
.terms-body h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.terms-body p { margin: 0 0 4px; }
.terms-list { margin: 4px 0 0; padding-left: 20px; }
.terms-list li { margin-bottom: 4px; }
.terms-footer-note { text-align: center; font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (min-width: 768px) {
    .terms-body {
        max-width: var(--content-max); margin-left: auto; margin-right: auto; width: 100%; padding: 14px 16px;
        background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
    }
}

.upload-dropzone {
    border: 2px dashed var(--line);
    border-radius: 16px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: #eaf1ff;
}
.upload-icon { font-size: 30px; margin-bottom: 10px; color: var(--accent); }
.upload-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.upload-sub { font-size: 12px; color: var(--ink-dim); margin-bottom: 14px; }
.upload-select-btn {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: white;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
}
.upload-divider {
    display: flex; align-items: center; text-align: center;
    color: var(--ink-dim); font-size: 12px; margin: 18px 0;
}
.upload-divider::before, .upload-divider::after {
    content: ''; flex: 1; border-bottom: 1px solid var(--line);
}
.upload-divider span { padding: 0 12px; }
.upload-paste-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
}
.format-support { margin-top: 24px; font-size: 12px; }
.format-support-title { font-weight: 700; color: var(--ink); margin-right: 6px; }
.format-tags { color: var(--ink-dim); }
.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}
.image-lightbox.active {
    display: flex;
}
.image-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
