:root {
    --bg: #f4efe3;
    --bg-deep: #dcc9a3;
    --panel: rgba(255, 251, 242, 0.9);
    --line: rgba(16, 35, 26, 0.15);
    --text: #10231a;
    --muted: #4d5b53;
    --accent: #d95f32;
    --accent-dark: #7a2e11;
    --secondary: #1f5c46;
    --shadow: 0 18px 60px rgba(16, 35, 26, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(217, 95, 50, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(31, 92, 70, 0.18), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-deep));
    font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
}

.page-shell {
    max-width: 1220px;
    margin: 0 auto;
    padding:
        calc(24px + env(safe-area-inset-top))
        calc(20px + env(safe-area-inset-right))
        calc(48px + env(safe-area-inset-bottom))
        calc(20px + env(safe-area-inset-left));
}

.hero {
    padding: 24px 6px 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    font-weight: 700;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.94;
    font-family: Georgia, "Times New Roman", serif;
}

.hero-copy {
    max-width: 720px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.65;
}

.status-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(217, 95, 50, 0.12);
    color: var(--accent-dark);
    border: 1px solid rgba(217, 95, 50, 0.22);
    font-size: 0.92rem;
}

.badge.secondary {
    background: rgba(31, 92, 70, 0.1);
    border-color: rgba(31, 92, 70, 0.2);
    color: var(--secondary);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 22px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.panel-head {
    padding: 22px 24px 12px;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.panel-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 72dvh;
}

.messages {
    flex: 1;
    min-height: 280px;
    margin: 0 20px;
    padding: 12px;
    overflow-y: auto;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(16, 35, 26, 0.08);
}

.message {
    margin: 12px 0;
    padding: 18px 20px;
    border-radius: 18px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.message.user {
    margin-left: 12%;
    background: #10231a;
    color: #f8f5ef;
}

.message.assistant {
    margin-right: 12%;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
}

.message-meta {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.8rem;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 20px 18px;
}

.quick-action {
    padding: 11px 13px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

.quick-action,
.composer button {
    touch-action: manipulation;
}

.quick-action:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.82);
}

.composer {
    margin: 0 20px 20px;
    padding: 18px;
    border: 2px solid rgba(217, 95, 50, 0.22);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(16, 35, 26, 0.06);
}

.composer-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--accent-dark);
}

.composer-help {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.model-toolbar {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.model-picker {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.model-picker input,
.model-picker select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(16, 35, 26, 0.16);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    font: inherit;
}

.model-picker input:focus,
.model-picker select:focus {
    outline: none;
    border-color: rgba(217, 95, 50, 0.9);
    box-shadow: 0 0 0 4px rgba(217, 95, 50, 0.12);
}

.model-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.voice-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.voice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(16, 35, 26, 0.05);
    color: var(--text);
    font-size: 0.92rem;
}

.voice-toggle input {
    accent-color: var(--secondary);
}

.voice-status {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(31, 92, 70, 0.08);
    border: 1px solid rgba(31, 92, 70, 0.14);
    color: var(--secondary);
    font-size: 0.93rem;
    line-height: 1.45;
}

.voice-status[data-state="listening"] {
    background: rgba(217, 95, 50, 0.08);
    border-color: rgba(217, 95, 50, 0.2);
    color: var(--accent-dark);
}

.voice-status[data-state="processing"] {
    background: rgba(16, 35, 26, 0.06);
    border-color: rgba(16, 35, 26, 0.14);
    color: var(--text);
}

.voice-status[data-state="error"] {
    background: rgba(122, 46, 17, 0.08);
    border-color: rgba(122, 46, 17, 0.2);
    color: var(--accent-dark);
}

.composer textarea {
    width: 100%;
    resize: vertical;
    min-height: 120px;
    padding: 16px;
    border-radius: 18px;
    border: 2px solid rgba(16, 35, 26, 0.14);
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    outline: none;
}

.composer textarea:focus {
    border-color: rgba(217, 95, 50, 0.9);
    box-shadow: 0 0 0 4px rgba(217, 95, 50, 0.12);
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.composer button {
    min-width: 128px;
    padding: 13px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #f08e64);
    color: #fffaf4;
    font-weight: 700;
    cursor: pointer;
}

.composer button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.composer .voice-button {
    min-width: 170px;
    background: linear-gradient(135deg, var(--secondary), #3d8a6f);
    color: #f7f4ee;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.composer .voice-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 92, 70, 0.2);
}

.composer .voice-button[data-active="true"] {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.entries {
    display: grid;
    gap: 12px;
    padding: 10px 20px 24px;
}

.entry-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--line);
}

.entry-card h3 {
    margin: 0 0 8px;
    font-size: 1.06rem;
}

.entry-meta {
    color: var(--secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.entry-body {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
}

@media (max-width: 960px) {
    .page-shell {
        padding:
            calc(20px + env(safe-area-inset-top))
            calc(16px + env(safe-area-inset-right))
            calc(36px + env(safe-area-inset-bottom))
            calc(16px + env(safe-area-inset-left));
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .chat-panel {
        min-height: auto;
    }

    .message.user,
    .message.assistant {
        margin-left: 0;
        margin-right: 0;
    }

    .voice-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .composer .voice-button {
        width: 100%;
    }
}


.voice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.voice-panel {
    max-width: 720px;
    margin: 0 auto;
    padding: 10px 0 28px;
}

.voice-panel-head {
    text-align: center;
}

.voice-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 24px 18px;
}

.voice-button {
    min-width: 180px;
    padding: 16px 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.voice-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.voice-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.voice-button.primary {
    background: linear-gradient(135deg, var(--secondary), #3d8a6f);
    color: #f7f4ee;
    box-shadow: 0 12px 24px rgba(31, 92, 70, 0.18);
}

.voice-button.secondary {
    background: rgba(16, 35, 26, 0.08);
    color: var(--text);
    border: 1px solid rgba(16, 35, 26, 0.14);
}

.voice-panel .voice-status {
    max-width: 560px;
    margin: 0 auto;
}

@media (max-width: 960px) {
    .voice-panel {
        max-width: none;
    }

    .voice-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .voice-button {
        width: 100%;
    }
}
/* simple-home-ui */
.simple-home {
    background: #f7f1e4;
    color: #1c1a17;
    font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
}

.simple-home .page-shell {
    max-width: 920px;
    margin: 0 auto;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.simple-home .simple-hero {
    padding: 6px 4px 6px;
}

.simple-home .simple-brand {
    margin: 0;
    font-size: clamp(1.1rem, 4vw, 1.8rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-family: Georgia, "Times New Roman", serif;
}

.simple-home .simple-mode {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #5c5041;
}

.simple-home .simple-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.simple-home .simple-panel {
    flex: 0 0 auto;
    margin: 0 8px 4px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 252, 246, 0.92);
    border: 1.5px solid rgba(54, 44, 34, 0.16);
    box-shadow: 0 6px 20px rgba(65, 48, 27, 0.06);
    display: flex;
    flex-direction: column;
}

.simple-home .simple-controls {
    display: flex;
    gap: 8px;
}

.simple-home .simple-action {
    width: 100%;
    min-width: 0;
    min-height: 102px;
    padding: 24px 24px;
    border-radius: 12px;
    border: 2px solid #3f352a;
    background: #fffdf7;
    color: #241f19;
    font-size: clamp(1.3rem, 4.8vw, 1.95rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: left;
    box-shadow: none;
}

.simple-home .simple-action:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #fff8ef;
}

.simple-home .simple-action.primary {
    flex: 2;
    min-height: 52px;
    padding: 8px 12px;
    background: #fffaf1;
    font-size: clamp(0.95rem, 4vw, 1.25rem);
}

.simple-home .simple-action.secondary {
    flex: 1;
    min-height: 52px;
    padding: 8px 12px;
    background: #f5eee0;
    font-size: 0.9rem;
}

.simple-home .simple-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.simple-home .simple-status-wrap {
    margin-top: 20px;
}

.simple-home .simple-field-label {
    margin: 0 0 10px;
    font-size: 1.08rem;
    font-weight: 700;
    color: #3f352a;
}

.simple-home .simple-status-box {
    max-width: none;
    margin: 6px 0 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #3f352a;
    background: #fffdf7;
    color: #3a5d46;
    font-size: 0.92rem;
    line-height: 1.4;
}

/* Map Integration Styles */
.simple-home .map-panel {
    flex: 3;
    margin: 2px 8px 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1.5px solid rgba(54, 44, 34, 0.16);
    background: #fdfaf3;
}

.simple-home .map-status {
    padding: 8px 14px;
    font-size: 0.85rem;
    background: #fdfaf3;
    border-bottom: 1px solid rgba(54, 44, 34, 0.1);
    color: #5c5041;
}

.simple-home .map-container {
    flex: 1;
    width: 100%;
    background: #e5e0d5;
}

.simple-home .maxmap-card {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 80px;
    background: rgba(255, 252, 246, 0.96);
    border: 2px solid #3f352a;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-height: 40vh;
    overflow-y: auto;
    z-index: 5;
}

.simple-home .maxmap-card-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.simple-home .maxmap-card-body h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #241f19;
}

.simple-home .maxmap-card-body p {
    margin: 6px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.simple-home .maxmap-card-body .maxmap-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 0.88rem;
    margin: 8px 0;
    color: #5c5041;
}

.simple-home .maxmap-card-body .maxmap-photo {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
}

.simple-home .maxmap-card-body ul {
    padding-left: 1.2rem;
    margin: 8px 0 0;
    font-size: 0.92rem;
}

.simple-home .maxmap-quickbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fffdf7;
    border-top: 1.5px solid rgba(54, 44, 34, 0.16);
}

.simple-home .maxmap-quickbar button {
    flex: 1;
    background: #f7f1e4;
    color: #241f19;
    border: 1.5px solid #3f352a;
    border-radius: 10px;
    padding: 10px 4px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.simple-home .maxmap-quickbar button:active {
    background: #ece4d1;
}

.simple-home .simple-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    padding: 6px 14px 10px;
    background: #fdfaf3;
    border-top: 1px solid rgba(54, 44, 34, 0.08);
}

.simple-home .simple-meta,
.simple-home .simple-link {
    font-size: 0.95rem;
    color: #5c5041;
}

.simple-home .simple-link {
    text-decoration: none;
    border-bottom: 1px solid rgba(63, 53, 42, 0.35);
}

.simple-home .simple-link:hover {
    color: #241f19;
    border-bottom-color: rgba(36, 31, 25, 0.7);
}

.maxmap-marker-label {
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(54, 44, 34, 0.25);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.simple-home .pc-chat-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1.5px solid rgba(54, 44, 34, 0.2);
    background: #fffdf7;
}

.simple-home .pc-chat-messages {
    max-height: 160px;
    min-height: 40px;
    overflow-y: auto;
    padding: 4px 6px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #241f19;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.simple-home .pc-chat-messages:empty::before {
    content: "문자 대화 내역이 여기에 표시됩니다.";
    color: #9a8d77;
    font-style: italic;
}

.simple-home .pc-chat-msg {
    padding: 6px 10px;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.simple-home .pc-chat-msg.user {
    align-self: flex-end;
    background: #3f352a;
    color: #fdfaf3;
    max-width: 80%;
}

.simple-home .pc-chat-msg.assistant {
    align-self: flex-start;
    background: #f3ecda;
    color: #241f19;
    max-width: 85%;
}

.simple-home .pc-chat-msg.error {
    align-self: stretch;
    background: #fff1ea;
    color: #a33f16;
    border: 1px solid #a33f16;
}

.simple-home .pc-chat-form {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.simple-home .pc-chat-input {
    flex: 1;
    resize: none;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid rgba(54, 44, 34, 0.28);
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
    color: #241f19;
    outline: none;
}

.simple-home .pc-chat-input:focus {
    border-color: #3f352a;
}

.simple-home .pc-chat-send {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1.5px solid #3f352a;
    background: #3f352a;
    color: #fffdf7;
    font-weight: 700;
    cursor: pointer;
}

.simple-home .pc-chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.simple-home .voice-status[data-state="listening"] {
    background: #fff5eb;
    color: #8a4b19;
    border-color: #8a4b19;
}

.simple-home .voice-status[data-state="processing"] {
    background: #f3efe7;
    color: #2b2b2b;
    border-color: #3f352a;
}

.simple-home .voice-status[data-state="error"] {
    background: #fff1ea;
    color: #a33f16;
    border-color: #a33f16;
}

@media (max-width: 720px) {
    .simple-home .page-shell {
        padding: 22px 14px 40px;
    }

    .simple-home .simple-action {
        min-height: calc(100dvh / 15);
        padding: 6px 12px;
        font-size: 0.95rem;
    }

    .simple-home .simple-action.primary {
        min-height: calc(100dvh / 15);
        padding: 6px 12px;
        font-size: 1rem;
    }

    .simple-home .simple-action.secondary {
        min-height: calc(100dvh / 15);
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .simple-home .simple-status-box {
        min-height: 44px;
        padding: 4px 12px;
        font-size: 0.88rem;
    }

    .simple-home .simple-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .simple-home .pc-chat-panel {
        display: none;
    }
}