:root {
    --bg: #f8f4ed;
    --bg-soft: #f2ece3;
    --surface: #ffffff;
    --surface-soft: #fcf8f2;
    --text: #2b211c;
    --muted: #7c6a62;
    --border: rgba(83, 58, 43, 0.1);
    --brand: #8f3a2e;
    --brand-strong: #6f291f;
    --brand-soft: rgba(143, 58, 46, 0.12);
    --dark: #1c1917;
    --dark-soft: rgba(255, 244, 228, 0.12);
    --success: #2e8a62;
    --warning: #c88d2f;
    --danger: #b64a3a;
    --shadow: 0 10px 24px rgba(38, 26, 21, 0.08);
    --shadow-strong: 0 18px 32px rgba(38, 26, 21, 0.12);
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --page-gutter: clamp(0.4rem, 2vw, 0.75rem);
    --section-gap: clamp(0.62rem, 2.4vw, 0.78rem);
    --card-gap: clamp(0.55rem, 2vw, 0.72rem);
    --control-height: clamp(2.2rem, 9vw, 2.4rem);
    --control-pad-x: clamp(0.7rem, 2.8vw, 0.9rem);
    --control-font: clamp(0.78rem, 2.7vw, 0.86rem);
    --mini-size: clamp(2rem, 7vw, 2.2rem);
    --brand-title-size: clamp(1.26rem, 5.4vw, 1.52rem);
    --brand-subtitle-size: clamp(0.72rem, 2.5vw, 0.78rem);
    --eyebrow-size: clamp(0.58rem, 1.9vw, 0.66rem);
    --hero-title-size: clamp(1.4rem, 6.8vw, 1.72rem);
    --hero-text-size: clamp(0.8rem, 2.7vw, 0.86rem);
    --section-title-size: clamp(0.96rem, 3vw, 1.04rem);
    --body-size: clamp(0.81rem, 2.5vw, 0.86rem);
    --meta-size: clamp(0.72rem, 2.2vw, 0.78rem);
    --topbar-offset: calc(4rem + env(safe-area-inset-top));
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    font-family: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(201, 171, 121, 0.16), transparent 22%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body.is-locked {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: env(safe-area-inset-top);
    background: var(--dark);
    color: #fff4e2;
    box-shadow: 0 12px 22px rgba(18, 14, 13, 0.2);
}

.topbar-inner,
.content-shell,
.quick-dock {
    width: min(31rem, calc(100% - var(--page-gutter)));
    margin: 0 auto;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.58rem 0 0.62rem;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 2.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 205, 120, 0.24);
    background: rgba(255, 194, 104, 0.1);
    color: #f0bf77;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.brand-block {
    min-width: 0;
}

.eyebrow,
.section-eyebrow,
.scene-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: var(--eyebrow-size);
}

.brand-block .eyebrow {
    color: rgba(255, 224, 180, 0.66);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-title,
.scene-title,
.sheet-title,
.guide-title,
.detail-name,
.fullscreen-primary,
.hotel-title {
    margin: 0;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    letter-spacing: -0.03em;
}

.brand-title {
    font-size: var(--brand-title-size);
    line-height: 0.94;
    color: #fff4e2;
}

.brand-subtitle {
    margin: 0.08rem 0 0;
    color: rgba(255, 233, 204, 0.78);
    font-size: var(--brand-subtitle-size);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-shell {
    display: grid;
    gap: var(--section-gap);
    padding: 0.55rem 0 0;
}

.tabs-wrap,
.scene-hero,
.scene-body {
    scroll-margin-top: calc(var(--topbar-offset) + 0.65rem);
}

.tabs-wrap {
    position: sticky;
    top: var(--topbar-offset);
    z-index: 30;
    margin: -0.05rem -0.1rem 0;
    padding: 0.06rem 0.1rem 0.24rem;
    background: linear-gradient(180deg, rgba(248, 244, 237, 0.98), rgba(248, 244, 237, 0.82));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.tabs-container,
.city-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.42rem, 1.8vw, 0.55rem);
}

.tab-button,
.chip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    flex: 1 1 30%;
    min-height: var(--control-height);
    padding: 0.54rem var(--control-pad-x);
    border-radius: 999px;
    border: 1px solid rgba(83, 58, 43, 0.1);
    background: rgba(255, 255, 255, 0.84);
    color: var(--muted);
    font-size: var(--control-font);
    font-weight: 780;
    box-shadow: 0 8px 18px rgba(38, 26, 21, 0.04);
    white-space: normal;
    text-align: center;
    word-break: break-word;
    -webkit-text-fill-color: currentColor;
}

.chip-button {
    flex: 0 1 auto;
}

.tab-button.is-active {
    background: var(--accent, var(--brand));
    color: #fff8f2;
    border-color: transparent;
    box-shadow: 0 12px 22px rgba(38, 26, 21, 0.14);
}

.chip-button.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: transparent;
}

.chip-add-button {
    background: rgba(143, 58, 46, 0.08);
    color: var(--brand);
}

.tab-icon {
    font-size: 0.92rem;
}

.scene-hero {
    position: relative;
    overflow: hidden;
    min-height: clamp(8rem, 31vw, 8.8rem);
    padding: clamp(0.9rem, 3.4vw, 1.04rem) clamp(0.88rem, 3.3vw, 1rem);
    border-radius: 1.4rem;
    background: linear-gradient(135deg, var(--scene-from), var(--scene-to));
    box-shadow: var(--shadow-strong);
    color: #fff7ef;
}

.scene-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 84% 28%, rgba(255, 255, 255, 0.14), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.1));
    pointer-events: none;
}

.scene-hero-copy {
    position: relative;
    z-index: 1;
    max-width: calc(100% - 2.8rem);
}

.scene-kicker {
    color: rgba(255, 247, 239, 0.8);
}

.scene-title {
    margin-top: 0.28rem;
    font-size: var(--hero-title-size);
    line-height: 1.08;
    max-width: 11ch;
}

.scene-tip {
    margin: 0.42rem 0 0;
    color: rgba(255, 247, 239, 0.9);
    font-size: var(--hero-text-size);
    line-height: 1.42;
}

.scene-icon-mark {
    position: absolute;
    right: 0.72rem;
    bottom: 0.35rem;
    z-index: 0;
    font-size: 3.5rem;
    line-height: 1;
    opacity: 0.12;
}

.scene-body,
.subsection,
.hotel-form,
.detail-block,
.sheet-body,
.fullscreen-body {
    display: grid;
    gap: var(--card-gap);
}

.subsection-head,
.hotel-header,
.sheet-head,
.fullscreen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.subsection-head h3,
.action-title,
.empty-title {
    margin: 0;
}

.subsection-head h3 {
    font-size: var(--section-title-size);
    line-height: 1.24;
}

.subsection-copy,
.hotel-storage-note,
.sheet-copy,
.guide-text,
.detail-text,
.detail-note,
.hotel-subtitle,
.hotel-address,
.hotel-contact,
.hotel-note,
.empty-text,
.action-meta,
.phrase-tr,
.fullscreen-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.hotel-storage-note,
.subsection-copy,
.sheet-copy,
.detail-text,
.detail-note,
.hotel-subtitle,
.hotel-address,
.hotel-contact,
.hotel-note,
.empty-text,
.action-meta,
.phrase-tr,
.fullscreen-note {
    font-size: var(--body-size);
}

.quick-info-grid,
.hotel-list,
.phrase-list {
    display: grid;
    gap: var(--card-gap);
}

.phrase-card,
.hotel-card,
.quick-info-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.phrase-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(0.55rem, 2vw, 0.68rem);
    padding: clamp(0.78rem, 2.8vw, 0.9rem);
}

.card-copy {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
}

.card-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    font-size: var(--meta-size);
    color: var(--muted);
}

.card-dot {
    width: 0.46rem;
    height: 0.46rem;
    flex: 0 0 0.46rem;
    border-radius: 999px;
    background: var(--accent, var(--brand));
    box-shadow: 0 0 0 0.18rem var(--accent-soft, rgba(143, 58, 46, 0.12));
}

.phrase-zh {
    margin: 0;
    font-size: var(--meta-size);
    line-height: 1.4;
    color: var(--muted);
}

.phrase-en {
    margin: 0;
    font-size: clamp(0.96rem, 3.2vw, 1.04rem);
    font-weight: 800;
    line-height: 1.28;
    color: var(--text);
    overflow-wrap: anywhere;
}

.phrase-tr {
    margin: 0;
    font-size: var(--body-size);
    line-height: 1.52;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.phrase-actions {
    display: grid;
    gap: clamp(0.34rem, 1.4vw, 0.42rem);
    flex: 0 0 auto;
    align-self: stretch;
}

.phrase-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-width: 3.4rem;
    min-height: 2.2rem;
    padding: 0.5rem 0.62rem;
    border-radius: 1rem;
    border: 1px solid rgba(83, 58, 43, 0.1);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    box-shadow: 0 0.35rem 0.8rem rgba(38, 26, 21, 0.05);
    -webkit-text-fill-color: currentColor;
}

.phrase-action-button-en {
    color: var(--accent, var(--brand));
    background: var(--accent-soft, rgba(143, 58, 46, 0.12));
}

.phrase-action-button-tr {
    color: var(--text);
    background: rgba(43, 33, 28, 0.06);
}

.phrase-action-button-view {
    color: var(--muted);
}

.action-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
}

.action-tag {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quick-info-card {
    display: grid;
    gap: 0.55rem;
    padding: clamp(0.8rem, 2.8vw, 0.9rem);
    text-align: left;
}

.action-title {
    font-size: clamp(0.9rem, 2.9vw, 0.98rem);
    line-height: 1.32;
}

.hotel-header {
    flex-direction: column;
    align-items: stretch;
}

.hotel-create-button {
    align-self: flex-start;
}

.city-chip-row {
    padding-bottom: 0.1rem;
}

.city-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    min-height: 1.25rem;
    padding: 0 0.38rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 800;
}

.hotel-list {
    gap: var(--card-gap);
}

.hotel-card {
    display: grid;
    gap: var(--card-gap);
    padding: clamp(0.8rem, 2.8vw, 0.9rem);
}

.hotel-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.hotel-meta {
    margin: 0;
    font-size: var(--meta-size);
    color: var(--muted);
}

.hotel-title {
    margin-top: 0.16rem;
    font-size: clamp(0.96rem, 3.2vw, 1.04rem);
    line-height: 1.2;
}

.hotel-subtitle,
.hotel-address,
.hotel-contact,
.hotel-note,
.phrase-en {
    overflow-wrap: anywhere;
}

.hotel-card-actions,
.sheet-actions,
.form-actions,
.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.38rem, 1.7vw, 0.5rem);
}

.hotel-sheet-content,
.hotel-sheet-list {
    display: grid;
    gap: var(--card-gap);
}

.sheet-chip-row {
    margin-top: 0.1rem;
}

.empty-state {
    padding: 1rem;
}

.empty-title {
    font-size: 1rem;
    line-height: 1.28;
}

.icon-button,
.mini-button,
.ghost-button,
.primary-button,
.link-action,
.dock-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
    -webkit-text-fill-color: currentColor;
}

.icon-button,
.mini-button {
    width: var(--mini-size);
    height: var(--mini-size);
    flex: 0 0 var(--mini-size);
}

.icon-button {
    background: rgba(143, 58, 46, 0.08);
    color: var(--brand);
}

.icon-button.inverse {
    background: rgba(255, 255, 255, 0.12);
    color: #fff7ef;
}

.mini-button {
    background: rgba(143, 58, 46, 0.08);
    color: var(--brand);
}

.mini-button.secondary {
    background: rgba(43, 33, 28, 0.07);
    color: var(--text);
}

.ghost-button,
.primary-button,
.link-action,
.dock-button {
    min-height: var(--control-height);
    padding: 0.54rem var(--control-pad-x);
    font-size: var(--control-font);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    border: 1px solid var(--border);
}

.primary-button,
.link-action.primary,
.dock-button {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff8f2;
    box-shadow: 0 14px 24px rgba(111, 41, 31, 0.16);
}

.link-action {
    background: rgba(143, 58, 46, 0.08);
    color: var(--brand);
    border: 1px solid rgba(143, 58, 46, 0.08);
}

.link-action.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.quick-dock {
    position: fixed;
    left: 50%;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.45rem, 1.8vw, 0.58rem);
    transform: translateX(-50%);
}

.fullscreen-actions {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.45rem, 1.8vw, 0.58rem);
}

.fullscreen-actions > button {
    flex: 1 1 45%;
}

.dock-button {
    flex: 1 1 45%;
    border-radius: 1.1rem;
}

.dock-button-secondary {
    background: rgba(28, 25, 23, 0.92);
    color: #fff4e2;
    box-shadow: 0 14px 24px rgba(18, 14, 13, 0.18);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    align-items: end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 18, 16, 0.48);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.sheet-card,
.fullscreen-card {
    position: relative;
    z-index: 1;
    width: min(31rem, calc(100% - 1rem));
    margin: 0 auto max(0.5rem, env(safe-area-inset-bottom));
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid rgba(83, 58, 43, 0.08);
    box-shadow: 0 24px 48px rgba(18, 14, 13, 0.18);
    transform: translateY(2rem);
    transition: transform 0.22s ease;
}

.modal.is-open .sheet-card,
.modal.is-open .fullscreen-card {
    transform: translateY(0);
}

.sheet-card {
    padding: 1rem;
    max-height: min(82vh, 46rem);
    overflow: auto;
}

.quick-sheet-card {
    min-height: calc(100vh - 0.75rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100vh - 0.75rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto 1fr;
}

.quick-sheet-card .sheet-body {
    overflow: auto;
    align-content: start;
}

.sheet-head {
    margin-bottom: 0.8rem;
}

.section-eyebrow {
    color: rgba(124, 106, 98, 0.82);
}

.sheet-copy {
    overflow-wrap: anywhere;
}

.sheet-title {
    font-size: 1.28rem;
    line-height: 1.08;
}

.detail-name {
    font-size: 1rem;
    line-height: 1.3;
}

.hotel-form {
    gap: 0.78rem;
}

.field {
    display: grid;
    gap: 0.42rem;
}

.field-utilities {
    display: grid;
    gap: 0.45rem;
}

.field-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.82rem 0.92rem;
    border-radius: 1rem;
    border: 1px solid rgba(83, 58, 43, 0.12);
    background: var(--surface-soft);
    color: var(--text);
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(143, 58, 46, 0.18);
    border-color: rgba(143, 58, 46, 0.24);
}

.field-button {
    justify-self: start;
    min-height: 2.2rem;
}

.field-button.is-pending {
    opacity: 0.72;
    pointer-events: none;
}

.field-hint {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--muted);
}

.field-hint[data-tone="success"] {
    color: var(--success);
}

.field-hint[data-tone="warning"] {
    color: var(--danger);
}

.field-hint[data-tone="loading"] {
    color: var(--brand);
}

.hotel-candidate-list {
    display: grid;
    gap: 0.45rem;
}

.hotel-candidate-item {
    display: grid;
    gap: 0.18rem;
    justify-items: start;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(83, 58, 43, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    text-align: left;
}

.hotel-candidate-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
}

.hotel-candidate-address {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.hidden {
    display: none !important;
}

.fullscreen-modal {
    align-items: stretch;
}

.fullscreen-card {
    min-height: calc(100vh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 1rem;
    background: linear-gradient(180deg, #221a16 0%, #140f0d 100%);
    color: #fff7ef;
}

.fullscreen-head {
    align-items: center;
}

.fullscreen-body {
    align-content: center;
    text-align: left;
    gap: 1rem;
    padding: 1rem 0 1.25rem;
}

.fullscreen-primary {
    font-size: 2rem;
    line-height: 1.04;
}

.fullscreen-secondary,
.fullscreen-tertiary {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.6;
}

.fullscreen-secondary {
    color: rgba(255, 247, 239, 0.84);
}

.fullscreen-tertiary {
    color: rgba(255, 247, 239, 0.72);
}

.fullscreen-address {
    display: none;
    white-space: pre-line;
    padding: 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff7ef;
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.fullscreen-address.has-content {
    display: block;
}

.fullscreen-note {
    color: rgba(255, 247, 239, 0.7);
}

.playing {
    transform: scale(0.98);
    opacity: 0.86;
}

.icon-button:focus-visible,
.mini-button:focus-visible,
.phrase-action-button:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.link-action:focus-visible,
.dock-button:focus-visible,
.tab-button:focus-visible,
.chip-button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 2px solid rgba(143, 58, 46, 0.28);
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .tab-button {
        flex-basis: 48%;
    }

    .phrase-card {
        align-items: flex-start;
    }

    .quick-dock {
        width: calc(100% - 0.75rem);
    }
}

@media (max-width: 360px) {
    .topbar-inner,
    .content-shell,
    .quick-dock,
    .sheet-card,
    .fullscreen-card {
        width: calc(100% - 0.75rem);
    }

    .brand-mark {
        width: 1.95rem;
        height: 1.95rem;
        flex-basis: 1.95rem;
        font-size: 0.68rem;
    }

    .brand-title {
        font-size: 1.34rem;
    }

    .tab-button,
    .chip-button {
        min-height: 2.18rem;
        padding-inline: 0.7rem;
        font-size: 0.8rem;
    }

    .tab-button {
        flex-basis: 100%;
    }

    .scene-hero {
        padding: 0.9rem 0.88rem;
    }

    .scene-title {
        font-size: 1.48rem;
    }

    .phrase-card,
    .hotel-card,
    .quick-info-card {
        padding: 0.8rem;
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        gap: 0.5rem;
    }

    .brand-row {
        flex: 1 1 100%;
    }

    .tabs-container {
        align-items: stretch;
    }

    .tab-button {
        flex: 1 1 calc(50% - 0.5rem);
    }
}
