* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
    background:
        radial-gradient(circle at 15% 8%, rgba(255, 173, 92, 0.08), transparent 22%),
        linear-gradient(180deg, #fff 0, #fffaf6 100%);
    color: #222;
    font-size: 13px;
}
.wrap { width: 100%; max-width: none; margin: 0; padding: 0; }
.screens-area { padding: 24px 32px 10px; }
.screen { overflow-x: auto; padding: 2px 2px 12px; }
.screen table { width: 100%; min-width: 720px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.topbar .mode {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
}
.topbar .mode.view { background: #e8f0fb; color: #1f6fd6; }
.topbar .mode.admin { background: #fdeede; color: #d77a14; }
.topbar a {
    font-size: 13px;
    color: #1f6fd6;
    text-decoration: none;
    font-weight: bold;
}
.topbar a:hover { text-decoration: underline; }

.cust-head {
    background: #f4f6f9;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.cust-head h1 { font-size: 24px; margin: 0; display: inline-block; }
.cust-head .sub { font-size: 13px; color: #444; margin-left: 10px; font-weight: bold; }
.rx { font-size: 12px; text-align: right; color: #555; }
.rx b { color: #1f6fd6; }
.rx .top { margin-bottom: 4px; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #dfe4ea;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    overflow: hidden;
    margin: 12px 0 18px;
}
.info-cell { background: #fff; padding: 8px 12px; }
.info-cell .lbl { font-size: 11px; color: #8a93a0; }
.info-cell .val { font-size: 14px; margin-top: 2px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab-btn {
    border: 1px solid #c5cdd8;
    background: #fff;
    color: #44505f;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}
.tab-btn.active { background: #ef8f2a; color: #fff; border-color: #ef8f2a; }

.screen { display: none; }
.screen.active { display: block; }

.banner {
    background: linear-gradient(90deg, #f4881f, #f6a24a);
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 9px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.info-tabs { margin: 0 0 14px; font-size: 13px; color: #8a8f96; text-align: center; }
.info-tabs .group { margin-bottom: 4px; }
.info-tabs .group b { display: none; }
.info-tabs .chip { display: inline-block; margin: 0 10px; cursor: pointer; }
.info-tabs .chip:hover { color: #f4881f; }
.info-tabs .chip.on { color: #f4881f; font-weight: bold; }

.tbl-title {
    color: #f15a09 !important;
    font-weight: 900;
    font-size: 18px;
    margin: 18px 4px 9px;
    font-style: normal;
    letter-spacing: -0.5px;
}

.table-card {
    position: relative;
    margin-top: 42px;
}
.table-card.has-title { margin-top: 0; }
.table-mascot {
    position: absolute;
    z-index: 3;
    top: -46px;
    right: 20px;
    width: 76px;
    height: 76px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 5px 5px rgba(176, 76, 10, 0.16));
}
.table-card.has-title .table-mascot { top: -7px; }
.table-mascot.mascot-1 {
    top: -50px;
    width: 80px;
    height: 80px;
}
.table-mascot.mascot-2 {
    top: -52px;
    right: 14px;
    width: 84px;
    height: 84px;
    transform: rotate(2deg);
}
.table-mascot.mascot-3 {
    top: -48px;
    right: 24px;
    width: 78px;
    height: 78px;
}
.table-card.has-title .table-mascot.mascot-1,
.table-card.has-title .table-mascot.mascot-2,
.table-card.has-title .table-mascot.mascot-3 {
    top: -9px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ffc9a7;
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(190, 89, 21, 0.08);
}
th, td {
    border: 0;
    border-right: 1px solid #f7d9c5;
    border-bottom: 1px solid #f7d9c5;
    text-align: center;
    padding: 0;
}
tr > :last-child { border-right: 0; }
tbody tr:last-child > td { border-bottom: 0; }
th.grp {
    color: #fff;
    font-weight: 900;
    padding: 10px 5px;
    font-size: 14px;
    text-shadow: 0 1px 1px rgba(127, 48, 0, 0.12);
}
th.sub {
    color: #fff;
    font-weight: 800;
    padding: 9px 4px;
    font-size: 11px;
    line-height: 1.35;
}
td.rowlbl {
    background: #fffdfb;
    color: #202020;
    font-weight: 800;
    width: 104px;
    padding: 9px 6px;
    white-space: nowrap;
}
td.corner {
    background: #f4881f;
    border-bottom-color: rgba(255,255,255,0.38);
}
td.corner-lbl {
    background: #f47b20;
    color: #fff;
    font-weight: 900;
    font-size: 11px;
    padding: 9px 5px;
}
td.cell { background: #fff; }
tbody tr:nth-child(even) td.cell,
tbody tr:nth-child(even) td.textcell,
tbody tr:nth-child(even) td.rowlbl { background: #fffaf6; }
tbody tr:hover td.cell,
tbody tr:hover td.textcell,
tbody tr:hover td.rowlbl { background: #fff3e9; }
td.cell .price {
    display: block;
    padding: 10px 3px;
    font-size: 12px;
    font-weight: 600;
    color: #262626;
}
td.cell .price.dash { color: #c0c6cf; }
td.cell input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 12px;
    padding: 10px 3px;
    font-family: inherit;
    color: #333;
}
td.cell input:focus { outline: 2px solid #1f6fd6; background: #fffbe6; }
td.cell input.dash { color: #c0c6cf; }
td.textcell { background: #fff; font-size: 11px; padding: 8px 4px; color: #555; line-height: 1.3; }
td.textcell .pill {
    display: inline-block;
    background: #fff4ec;
    color: #e95d0b;
    border: 1px solid #ffe0cb;
    border-radius: 9px;
    padding: 6px 9px;
    font-weight: bold;
}

.ai-grid { align-items: flex-start; gap: 18px; }
.ai-grid > .ai-col { min-width: 360px; }
.ai-col table { min-width: 0; }
.ai-col th.grp,
.ai-col th.sub {
    background: linear-gradient(180deg, #ff7411 0%, #f05a00 100%) !important;
}
.ai-col td.corner,
.ai-col td.corner-lbl {
    background: linear-gradient(180deg, #ff7411 0%, #f05a00 100%);
}
.ai-col tbody tr:last-child td.rowlbl {
    color: #f05a00;
    font-size: 14px;
}
.ai-col tbody tr:last-child td {
    background: #fffaf5;
    padding-top: 9px;
    padding-bottom: 9px;
}

/* 편집(admin) 입력 필드 */
.hdr-input, .sub-input, .lbl-input, .text-input, .title-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-family: inherit;
}
.hdr-input { color: #fff; font-weight: bold; font-size: 13px; padding: 6px 2px; }
.sub-input { color: #fff; font-weight: bold; font-size: 11px; padding: 5px 2px; }
.lbl-input { color: #333; font-weight: bold; font-size: 12px; padding: 5px 2px; }
.text-input { color: #555; font-size: 11px; padding: 5px 2px; }
.title-input { text-align: left; font-weight: bold; font-style: italic; font-size: 15px; padding: 2px; }
.hdr-input::placeholder, .sub-input::placeholder { color: rgba(255,255,255,0.7); }
.hdr-input:focus, .sub-input:focus { background: rgba(0,0,0,0.18); outline: 1px solid #fff; }
.lbl-input:focus, .text-input:focus, .title-input:focus { outline: 2px solid #1f6fd6; background: #fffbe6; }
.chip-input {
    border: 1px solid #c5cdd8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: inherit;
    width: 140px;
    margin-right: 6px;
}
.chip-input:focus { outline: 2px solid #1f6fd6; background: #fffbe6; }

.savebar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dfe4ea;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    margin-top: 10px;
}
.btn-save {
    background: #1f6fd6; color: #fff; border: none;
    padding: 10px 24px; border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: bold;
}
.btn-save:hover { background: #185bb5; }
.btn-line {
    background: #fff; color: #555; border: 1px solid #c5cdd8;
    padding: 10px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-line:hover { background: #f3f5f8; }
.status { font-size: 13px; margin-left: 4px; }
.status.ok { color: #2e7d32; }
.status.err { color: #c62828; }

.ai-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.ai-grid > .ai-col { flex: 1; min-width: 320px; }

/* ===== 브랜딩 ===== */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 2px solid #fbe3cf;
}
.brand-side { display: flex; align-items: center; gap: 12px; }
.brand-right { justify-content: flex-end; flex-wrap: wrap; max-width: 420px; }
.owl { width: 60px; height: auto; }
.brand-logo { display: flex; flex-direction: column; }
.logo-name { font-size: 26px; font-weight: 800; color: #f47b20; line-height: 1.1; }
.logo-tag { font-size: 13px; color: #f49b53; font-weight: 600; }
.brand-center { flex: 1; display: flex; justify-content: center; }
.brand-center .tabs { margin: 0; justify-content: center; }
.brand-note {
    font-size: 12px;
    color: #f47b20;
    font-weight: 700;
    text-align: center;
    max-width: 200px;
    line-height: 1.4;
}
.admin-link {
    background: #f47b20;
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}
.admin-link:hover { background: #dd6a14; }

.brand-footer {
    display: flex;
    align-items: stretch;
    margin-top: 20px;
    border-top: 1px solid #eee;
    background: #fff;
}
.feat-list {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 18px 26px;
    flex-wrap: wrap;
}
.feat { display: flex; align-items: center; gap: 10px; }
.feat-ico { color: #f47b20; font-size: 18px; }
.feat-title { font-weight: bold; font-size: 14px; color: #333; }
.feat-desc { font-size: 12px; color: #888; margin-top: 2px; }
.brand-foot-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f47b20;
    color: #fff;
    padding: 16px 34px;
    border-top-left-radius: 44px;
}
.brand-foot-logo .logo-name { color: #fff; font-size: 22px; }
.brand-foot-logo .logo-tag { color: #ffe9d6; font-size: 12px; }
.brand-foot-logo .owl { width: 52px; }

/* 브랜딩 편집 입력 */
.logo-input, .note-input, .feat-input {
    border: 1px dashed #d0d6df;
    border-radius: 4px;
    font-family: inherit;
    padding: 2px 6px;
    background: #fff;
}
.logo-name.logo-input { font-size: 22px; font-weight: 800; color: #f47b20; width: 190px; }
.logo-tag.logo-input { font-size: 13px; color: #f49b53; width: 190px; margin-top: 3px; }
.note-input { width: 230px; font-size: 12px; color: #f47b20; font-weight: 700; }
.feat-title.feat-input { font-weight: bold; font-size: 13px; width: 150px; }
.feat-desc.feat-input { font-size: 12px; width: 150px; margin-top: 3px; }
.logo-input:focus, .note-input:focus, .feat-input:focus { outline: 2px solid #1f6fd6; background: #fffbe6; }

/* 발표자 펜 주석 */
#annotCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9000;
    pointer-events: none;
}
#annotCanvas.active {
    pointer-events: auto;
    cursor: crosshair;
}
.pen-toolbar {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    background: #fff;
    border: 1px solid #d0d6df;
    border-radius: 30px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.pen-toolbar button { cursor: pointer; }
.pen-toggle {
    border: 1px solid #c5cdd8;
    background: #fff;
    border-radius: 18px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 13px;
    color: #44505f;
}
.pen-toggle.on { background: #1f6fd6; color: #fff; border-color: #1f6fd6; }
.pen-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #c5cdd8;
    padding: 0;
}
.pen-color.sel { box-shadow: 0 0 0 2px #333; }
.pen-tool {
    border: 1px solid #c5cdd8;
    background: #fff;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 12px;
    color: #44505f;
}
.pen-tool.on { background: #ffe9a8; border-color: #e0b94a; color: #7a5b12; }
.pen-size-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
}
.pen-size { width: 90px; cursor: pointer; }
.pen-size-val {
    font-size: 12px;
    font-weight: bold;
    color: #44505f;
    min-width: 16px;
    text-align: center;
}

@media (max-width: 1100px) {
    .brand-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .brand-center {
        order: 3;
        flex-basis: 100%;
    }
    .brand-center .tabs { justify-content: flex-start; }
    .brand-right { max-width: none; }
    .ai-grid > .ai-col { min-width: 48%; }
}

@media (max-width: 720px) {
    body { font-size: 12px; }
    .screens-area { padding: 16px 12px 4px; }
    .brand-header { padding: 12px; }
    .brand-right .brand-note,
    .brand-right .owl { display: none; }
    .logo-name { font-size: 21px; }
    .owl { width: 48px; }
    .tab-btn { padding: 7px 10px; font-size: 12px; }
    .ai-grid { display: block; }
    .ai-grid > .ai-col { min-width: 0; }
    .ai-col table { min-width: 520px; }
    .tbl-title { font-size: 16px; }
    .table-card { margin-top: 32px; }
    .table-card.has-title { margin-top: 0; }
    .table-mascot {
        top: -35px;
        right: 12px;
        width: 58px;
        height: 58px;
    }
    .table-card.has-title .table-mascot { top: 0; }
    .table-mascot.mascot-1,
    .table-mascot.mascot-2,
    .table-mascot.mascot-3 {
        top: -38px;
        right: 10px;
        width: 62px;
        height: 62px;
    }
    .table-card.has-title .table-mascot.mascot-1,
    .table-card.has-title .table-mascot.mascot-2,
    .table-card.has-title .table-mascot.mascot-3 {
        top: -2px;
    }
    .brand-footer { flex-direction: column; }
    .feat-list { gap: 16px; padding: 16px; }
    .brand-foot-logo {
        justify-content: center;
        border-top-left-radius: 28px;
    }
}

/* FHD kiosk/front mode: fit the customer-facing screen in one fullscreen viewport. */
body.front-app {
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
}
body.front-app .brand-header {
    min-height: 94px;
    padding: 10px 22px 8px;
    gap: 12px;
}
body.front-app .brand-side { gap: 10px; }
body.front-app .brand-right {
    max-width: 410px;
    gap: 8px 12px;
}
body.front-app .owl { width: 48px; }
body.front-app .logo-name { font-size: 23px; line-height: 1; }
body.front-app .logo-tag { font-size: 12px; }
body.front-app .tabs {
    gap: 6px;
    margin-bottom: 6px;
}
body.front-app .tab-btn {
    min-width: 78px;
    padding: 7px 13px;
    font-size: 13px;
    border-radius: 8px;
}
body.front-app .secondary-tabs {
    gap: 2px 12px;
    line-height: 1.15;
}
body.front-app .secondary-tabs a {
    font-size: 12px;
    padding: 1px 0;
}
body.front-app .brand-note {
    max-width: 230px;
    font-size: 11px;
    line-height: 1.25;
}
body.front-app .admin-link {
    padding: 7px 12px;
    border-radius: 18px;
    font-size: 12px;
}
body.front-app .page-body {
    min-height: 0;
    overflow: hidden;
}
body.front-app .screens-area {
    height: 100%;
    padding: 8px 28px 0;
    overflow: hidden;
}
body.front-app .screen.active {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
body.front-app .banner {
    flex: 0 0 auto;
    margin-bottom: 7px;
    padding: 7px;
    border-radius: 5px;
    font-size: 16px;
}
body.front-app .info-tabs {
    flex: 0 0 auto;
    margin: 0 0 7px;
    font-size: 12px;
    line-height: 1.25;
}
body.front-app .info-tabs .group { margin-bottom: 2px; }
body.front-app .info-tabs .chip { margin: 0 8px; }
body.front-app .ai-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    overflow: hidden;
    align-items: stretch;
}
body.front-app .ai-grid > .ai-col {
    min-width: 0;
    display: flex;
    min-height: 0;
}
body.front-app .screen.active > :not(.banner):not(.info-tabs):not(.ai-grid) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
body.front-app .table-card {
    width: 100%;
    margin-top: 22px;
}
body.front-app .table-card.has-title { margin-top: 0; }
body.front-app .ai-col .table-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.front-app .tbl-title {
    margin: 4px 3px 5px;
    font-size: 17px;
    line-height: 1.15;
}
body.front-app .table-mascot {
    top: -30px;
    right: 16px;
    width: 54px;
    height: 54px;
}
body.front-app .table-card.has-title .table-mascot,
body.front-app .table-card.has-title .table-mascot.mascot-1,
body.front-app .table-card.has-title .table-mascot.mascot-2,
body.front-app .table-card.has-title .table-mascot.mascot-3 {
    top: -4px;
    width: 52px;
    height: 52px;
}
body.front-app table {
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(190, 89, 21, 0.06);
}
body.front-app .ai-col table {
    flex: 1 1 auto;
    height: 100%;
}
body.front-app .screen table {
    min-width: 0;
}
body.front-app th.grp {
    padding: 7px 4px;
    font-size: 13px;
    line-height: 1.15;
}
body.front-app th.sub {
    padding: 6px 3px;
    font-size: 10.5px;
    line-height: 1.18;
}
body.front-app td.corner-lbl {
    padding: 6px 4px;
    font-size: 10.5px;
}
body.front-app td.rowlbl {
    width: 92px;
    padding: 6px 4px;
    font-size: 12px;
}
body.front-app td.cell .price {
    padding: 6px 2px;
    font-size: 12px;
}
body.front-app td.textcell {
    padding: 5px 3px;
    font-size: 10.5px;
    line-height: 1.18;
}
body.front-app td.textcell .pill {
    padding: 4px 7px;
    border-radius: 7px;
}
body.front-app .brand-footer {
    min-height: 78px;
    margin-top: 0;
}
body.front-app .feat-list {
    gap: 18px;
    padding: 10px 24px;
    flex-wrap: nowrap;
}
body.front-app .feat { gap: 8px; min-width: 0; }
body.front-app .feat-ico {
    width: 30px;
    height: 30px;
    font-size: 15px;
    flex: 0 0 auto;
}
body.front-app .feat-title {
    font-size: 13px;
    white-space: nowrap;
}
body.front-app .feat-desc {
    font-size: 11px;
    white-space: nowrap;
}
body.front-app .brand-foot-logo {
    padding: 10px 28px;
    border-top-left-radius: 34px;
}
body.front-app .brand-foot-logo .owl { width: 42px; }
body.front-app .brand-foot-logo .logo-name { font-size: 22px; }
body.front-app .brand-foot-logo .logo-tag { font-size: 11px; }
body.front-app .pen-toolbar {
    right: 16px;
    bottom: 8px;
}

@media (min-width: 1500px) and (min-height: 850px) {
    body.front-app .screen.active > :not(.banner):not(.info-tabs):not(.ai-grid) {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

@media (max-height: 900px) {
    body.front-app .brand-header { min-height: 84px; padding-top: 7px; padding-bottom: 6px; }
    body.front-app .owl { width: 42px; }
    body.front-app .logo-name { font-size: 21px; }
    body.front-app .screens-area { padding-top: 5px; }
    body.front-app .brand-footer { min-height: 68px; }
    body.front-app .feat-list { padding-top: 7px; padding-bottom: 7px; }
    body.front-app .brand-foot-logo { padding-top: 7px; padding-bottom: 7px; }
}
