* {
    box-sizing: border-box;
}

:root {
    --bg: #e5e6e8;
    --app-bg: #f6f7f9;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --field-bg: #eef0f3;
    --track-bg: #e7eaef;
    --selected-bg: #eaf0f8;
    --line: #e6e9ee;
    --line-dark: #dde1e8;
    --text: #1b2330;
    --muted: #8b8f98;
    --label: #5d6470;
    --primary: #1d3a63;
    --primary-dark: #152b4a;
    --on-primary: #ffffff;
    --accent: #1d3a63;
    --accent-soft: #2d4d7a;
    --green: #0f766e;
    --red: #c0392b;
    --warning: #9a6a16;
    --shadow-card: 0 12px 30px -20px rgba(20, 30, 55, 0.28);
    --shadow-soft: 0 8px 22px -18px rgba(20, 30, 55, 0.3);
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", Arial, sans-serif;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.mobile-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: var(--bg);
}

.phone-frame {
    position: relative;
    width: min(100vw, 430px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    box-shadow: 0 30px 70px -28px rgba(20, 30, 55, 0.45), 0 8px 22px -12px rgba(20, 30, 55, 0.18);
    overflow: hidden;
}

.mobile-topbar {
    flex: 0 0 64px;
    z-index: 10;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--app-bg);
    box-shadow: 0 1px 0 rgba(28, 35, 48, 0.07);
}

.mobile-topbar strong,
.mobile-topbar span {
    display: block;
}

.mobile-topbar strong {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.mobile-topbar span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.page {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 18px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header p {
    margin-top: 6px;
    color: var(--accent-soft);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel,
.login-panel {
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
}

.panel {
    padding: 22px 20px;
    margin-bottom: 16px;
}

.panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    font-family: "JetBrains Mono", Consolas, monospace;
}

.issue-form {
    display: grid;
    gap: 17px;
}

label,
.field-group {
    display: grid;
    gap: 8px;
}

label > span,
.field-group > span {
    color: var(--label);
    font-size: 13px;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    background: var(--field-bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
}

textarea {
    padding: 13px 16px;
    resize: vertical;
    font-weight: 400;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-soft);
    outline-offset: 0;
}

select {
    appearance: none;
}

.uppercase-input {
    text-transform: uppercase;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 14px;
    font-weight: 500;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--track-bg);
}

.field-group:nth-of-type(2) .segmented {
    grid-template-columns: 1fr 1fr;
}

.segmented label {
    display: block;
}

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

.segmented span {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.segmented input:checked + span {
    background: #ffffff;
    box-shadow: 0 2px 6px -2px rgba(29, 58, 99, 0.25);
    color: var(--primary);
    font-weight: 700;
}

.form-section {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 14px;
    background: #f3f5f8;
}

.form-section summary {
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.form-section label {
    margin-top: 10px;
}

.form-actions {
    display: grid;
    padding-top: 4px;
}

button,
.download,
.alert a,
.more-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border: 0;
    border-radius: 13px;
    background: var(--primary);
    color: var(--on-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.download:hover,
.alert a:hover,
.more-button:hover {
    background: var(--primary-dark);
}

.form-actions button {
    min-height: 54px;
    border-radius: 14px;
    font-size: 16px;
}

.icon-text-button {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    background: transparent;
    color: var(--accent-soft);
    font-size: 14px;
    font-weight: 600;
}

.icon-text-button:hover {
    background: var(--selected-bg);
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px 17px;
    border-radius: 15px;
    background: var(--selected-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.alert > div {
    display: grid;
    gap: 2px;
    line-height: 1.35;
}

.alert strong {
    font-size: 16px;
    font-weight: 700;
}

.alert span {
    color: var(--accent-soft);
    font-weight: 600;
}

.alert.success {
    background: var(--selected-bg);
    color: var(--primary);
}

.alert.warning {
    background: #fbf0d8;
    color: var(--warning);
}

.alert.error {
    background: #f9e2de;
    color: var(--red);
}

.alert a {
    flex: none;
    min-height: 38px;
    width: fit-content;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 650;
}

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

.list-filter {
    margin-bottom: 16px;
}

.issue-item {
    display: grid;
    gap: 9px;
    padding: 16px 17px;
    border: 1px solid var(--line-dark);
    border-radius: 17px;
    background: var(--surface-strong);
    box-shadow: 0 6px 16px -14px rgba(20, 30, 55, 0.35);
}

.issue-main,
.issue-meta,
.issue-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.issue-main strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 700;
}

.issue-main span {
    flex: 0 0 auto;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--selected-bg);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.issue-meta,
.issue-footer {
    color: var(--muted);
    font-size: 13px;
}

.issue-fp {
    padding: 9px 11px;
    border-radius: 10px;
    background: #f3f5f8;
    color: #2d3340;
    font-size: 13px;
    overflow-x: auto;
}

.issue-options {
    padding: 8px 11px;
    border-radius: 10px;
    background: #f3f5f8;
    color: var(--label);
    font-size: 13px;
    line-height: 1.45;
}

.download {
    min-height: 32px;
    padding: 0;
    background: transparent;
    color: var(--accent-soft);
    font-size: 13px;
    font-weight: 650;
}

.download:hover {
    background: transparent;
    color: var(--primary);
}

.mono {
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
}

.empty-list {
    padding: 22px 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.list-actions {
    display: grid;
    margin-top: 14px;
}

.more-button {
    background: var(--selected-bg);
    color: var(--primary);
}

.more-button:hover {
    background: var(--track-bg);
    color: var(--primary);
}

.bottom-nav.nav-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.bottom-nav {
    flex: 0 0 auto;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
    background: var(--app-bg);
    box-shadow: 0 -1px 0 rgba(28, 35, 48, 0.07);
}

.bottom-link {
    min-height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: transparent;
    color: #6b7178;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.bottom-link.active {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: var(--bg);
}

.login-shell {
    width: min(100vw - 28px, 400px);
}

.login-panel {
    display: grid;
    gap: 17px;
    padding: 30px 26px;
    border-radius: 24px;
    background: var(--surface);
    overflow: visible;
    box-shadow: 0 30px 70px -28px rgba(20, 30, 55, 0.45), 0 8px 22px -12px rgba(20, 30, 55, 0.18);
}

.login-accent {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0 0 20px;
    background: transparent;
    box-shadow: 0 1px 0 var(--line);
}

.login-brand {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.login-title {
    display: grid;
    gap: 7px;
}

.login-title h1 {
    font-size: 25px;
}

.login-title p,
.login-panel p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

@media (min-width: 431px) {
    .phone-frame {
        height: min(900px, calc(100vh - 32px));
        height: min(900px, calc(100dvh - 32px));
        border-radius: 40px;
    }

    .mobile-topbar {
        border-radius: 40px 40px 0 0;
    }
}

/* EE 추가 옵션 체크박스 - 전역 input 스타일(높이 50 · 폭 100%)을 덮는다 */
.addon-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.addon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 11px;
    background: var(--field-bg);
    cursor: pointer;
}

.addon input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
}

.addon span {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.addon:has(input:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
}

.addon-hint {
    color: var(--muted);
    font-size: 12px;
}

/* 사이트 지문 조회 패널 */
.lookup-panel {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 13px;
    background: #eef4fb;
    font-size: 13px;
}

.lookup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lookup-body {
    color: var(--text);
    font-weight: 600;
}

.lookup-sub,
.lookup-none,
.lookup-filled {
    color: var(--muted);
    font-size: 12px;
}

.lookup-fill {
    justify-self: start;
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.state-active {
    color: #1d9e75;
    font-weight: 700;
}

.state-expired {
    color: #c2410c;
    font-weight: 700;
}

/* 고객별 리포트 경고 */
.report-warning {
    padding: 8px 11px;
    border-radius: 10px;
    background: #fef3e2;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.45;
}
