:root {
    color-scheme: dark;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #0c0e12;
    color: #eeeae2;
}
* { box-sizing: border-box; }
body { margin: 0; }
.app { min-height: 100vh; background: radial-gradient(ellipse at 50% -20%, #28231b 0, #0c0e12 50%); }
.header { height: 76px; border-bottom: 1px solid #292a2b; display: flex; align-items: center; justify-content: space-between; padding: 0 max(6vw, calc((100% - 1200px) / 2)); }
.brand, .overlay-top { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small, .overlay-top strong, .overlay-top small { display: block; }
.brand strong { font-size: 15px; }
.brand small, .overlay-top small { color: #92918e; font-size: 11px; margin-top: 3px; }
.brand-icon, .overlay-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #e6c27f; border: 1px solid #7d6136; background: #302719; font-family: Georgia, serif; font-weight: bold; font-size: 21px; }
.status { color: #a7a5a0; font-size: 12px; }
.account-header { display: flex; align-items: center; gap: 12px; }
.status span, .live-dot { display: inline-block; width: 7px; height: 7px; background: #a99470; border-radius: 50%; margin-right: 7px; }
main { max-width: 1200px; margin: auto; padding: 60px 24px 80px; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; }
.eyebrow { color: #bc9960; font-size: 10px; font-weight: 700; letter-spacing: .16em; margin: 0 0 10px; }
h1 { font-family: Georgia, serif; font-size: clamp(32px, 4vw, 46px); font-weight: 400; margin: 0; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.subtitle { color: #a7a5a0; margin: 12px 0 0; line-height: 1.5; }
.badge { border: 1px solid #4d4030; color: #c9ab7a; padding: 8px 10px; font-size: 10px; letter-spacing: .1em; white-space: nowrap; }
.notice { display: flex; gap: 16px; padding: 20px; background: #211d17; border: 1px solid #57452b; margin-bottom: 24px; }
.notice-icon { flex: 0 0 25px; width: 25px; height: 25px; border: 1px solid #b89459; color: #d7b87d; border-radius: 50%; text-align: center; line-height: 23px; }
.notice h2 { font-size: 14px; color: #e6c894; }
.notice p { color: #c2b9a9; line-height: 1.6; font-size: 13px; margin: 8px 0; }
a { color: #dfbd80; }
.notice a { font-size: 13px; font-weight: 600; }
.dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.panel { background: #16191e; border: 1px solid #303034; padding: 24px; }
aside { display: grid; gap: 20px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.muted { color: #999a9a; font-size: 12px; line-height: 1.6; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
label { color: #c9c7c1; font-size: 12px; }
select { display: block; width: 100%; margin-top: 9px; padding: 12px; background: #101216; color: #777a7b; border: 1px solid #34373a; }
.empty { text-align: center; padding: 65px 15px 48px; }
.empty-icon { color: #b89a6b; font-size: 40px; }
.empty p { color: #929394; font-size: 13px; line-height: 1.6; max-width: 300px; margin: auto; }
.value { font-family: Georgia, serif; font-size: 42px; margin-top: 22px; color: #ecd4a7; }
.value span { color: #a9a6a0; font: 14px "Segoe UI", sans-serif; }
.divider { height: 1px; background: #303034; margin: 20px 0; }
.button { display: block; margin-top: 20px; padding: 12px; text-align: center; text-decoration: none; color: #18150f; font-size: 13px; font-weight: 700; background: #cbaa72; }
.button:hover { background: #e1c18b; }
.hint { color: #767a7b; font-size: 11px; line-height: 1.5; margin: 14px 0 0; }
footer { color: #777a7b; border-top: 1px solid #292a2b; padding: 22px; text-align: center; font-size: 11px; }
.overlay-document, .overlay-body { background: transparent; }
.overlay-body { padding: 20px; }
.overlay-card { width: 720px; max-width: 100%; padding: 14px; background: rgba(15, 17, 21, .96); border: 1px solid #957446; box-shadow: 0 10px 35px rgba(0, 0, 0, .35); opacity: 1; transition: opacity .5s; }
.overlay-card.hidden { opacity: 0; }
.overlay-top strong { font-size: 12px; letter-spacing: .1em; }
.overlay-line { height: 1px; background: #51432d; margin: 10px 0; }
.overlay-label { color: #b99a69; font-size: 10px; letter-spacing: .14em; }
.overlay-value { display: flex; align-items: center; gap: 7px; color: #f0d7a8; font: 32px Georgia, serif; margin: 6px 0; }
.overlay-value span { color: #b3b0a9; font: 13px "Segoe UI", sans-serif; }
.overlay-note { color: #929394; font-size: 12px; }
.overlay-legend { color: #999a9a; font-size: 10px; margin-top: 8px; }
.overlay-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-top: 8px; }
.overlay-items:empty { display: none; }
.overlay-item { display: flex; flex-direction: column; align-items: center; padding: 5px; background: #222126; border: 1px solid #484036; text-align: center; }
.overlay-item-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #a7a5a0; }
.overlay-item-icon img, .overlay-item-icon span { grid-area: 1 / 1; }
.overlay-item-icon img { max-width: 40px; max-height: 40px; object-fit: contain; }
.overlay-item-icon span[hidden] { display: none; }
.overlay-item-count { color: #e6c894; font-size: 13px; margin: 2px 0; }
.overlay-item-name { color: #ded8ce; font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.overlay-item-price, .overlay-item-subtotal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; color: #c5bba9; font-size: 10px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
.overlay-item-subtotal { color: #e6c894; font-weight: 600; margin-top: 2px; }
.divine-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 14px; height: 14px; vertical-align: middle; }
.divine-icon img, .divine-icon .divine-fallback { grid-area: 1 / 1; }
.divine-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.divine-icon .divine-fallback { color: #c5bba9; font: 9px "Segoe UI", sans-serif; }
.overlay-value .divine-icon { width: 26px; height: 26px; }
.total-number { color: #ecd4a7 !important; font: inherit !important; }
.message { padding: 14px 18px; margin-bottom: 20px; border: 1px solid #536044; background: #1b251a; color: #cce0bc; font-size: 13px; line-height: 1.5; }
.message.error { border-color: #80534d; background: #2b1d1d; color: #f0c4bd; }
.message[hidden] { display: none; }
.auth-panel { max-width: 430px; }
.account-form { display: grid; gap: 12px; margin-top: 20px; }
.obs-panel > button { margin-top: 16px; width: 100%; }
.obs-panel > label { display: block; margin-top: 16px; }
[hidden] { display: none !important; }
.create-form, .item-form, .tab-row { display: grid; gap: 12px; align-items: end; margin-top: 24px; }
.create-form { grid-template-columns: 1fr 1fr auto; }
.tab-row { grid-template-columns: 1fr auto; }
.item-form { grid-template-columns: 1fr 1fr; }
.item-search { grid-column: 1 / -1; min-width: 0; }
.search-results { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.search-result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #101216; border-color: #34373a; color: #eeeae2; }
.search-result:hover:enabled, .search-result[aria-pressed="true"] { background: #30291f; border-color: #cbaa72; }
.search-result:focus-visible { outline: 2px solid #e6c27f; outline-offset: -3px; }
.search-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; color: #999a9a; }
.search-icon img, .search-icon span { grid-area: 1 / 1; }
.search-icon img { max-width: 42px; max-height: 42px; object-fit: contain; }
.search-description { flex: 1; min-width: 0; }
.search-description strong, .search-description small { display: block; overflow-wrap: anywhere; }
.search-description small { color: #999a9a; margin-top: 5px; font-weight: 400; }
.search-price { color: #e6c894; font-size: 12px; }
input, button { font: inherit; }
input { display: block; width: 100%; margin-top: 9px; padding: 12px; background: #101216; color: #eeeae2; border: 1px solid #34373a; }
input:disabled { color: #777a7b; }
button { padding: 12px 14px; border: 1px solid #cbaa72; background: #cbaa72; color: #18150f; font-size: 12px; font-weight: 700; cursor: pointer; }
button:hover:enabled { background: #e1c18b; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: transparent; border-color: #625a4c; color: #d3c4ad; }
button.secondary:hover:enabled { background: #30291f; }
.items { margin-top: 25px; border-top: 1px solid #303034; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 85px 85px auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #303034; }
.item-row input { margin: 0; padding: 9px; }
.item-title strong, .item-title small { display: block; overflow-wrap: anywhere; }
.item-title strong { font-size: 13px; }
.item-title small { color: #999a9a; margin-top: 5px; font-size: 11px; }
.item-subtotal { color: #e6c894; font-size: 12px; text-align: right; }
.empty-list { padding: 24px 0; }
.overlay-value #overlay-value { color: #f0d7a8; font: inherit; }
@media (max-width: 700px) {
    main { padding-top: 40px; }
    .intro { align-items: flex-start; flex-direction: column; }
    .dashboard { grid-template-columns: 1fr; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .create-form, .tab-row { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: minmax(0, 1fr) 75px; }
    .item-subtotal { text-align: left; }
}
