body { margin: 0; min-height: 100vh; min-height: 100dvh; background: #F2EDE4; font-family: 'Jost', sans-serif; color: #1C2842; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: #B8923E; }
input, textarea, button { font-family: inherit; }
[hidden] { display: none !important; }

.eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: #B8923E; margin-bottom: 8px; }
h1 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 40px; line-height: 1.1; margin: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #5E6473; }
input, textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #D9CFC0; border-radius: 0; background: #fff; font-size: 14px; line-height: 1.5; outline: 0; color: #1C2842; -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus { border-color: #B8923E; }
textarea { resize: vertical; }
input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; width: auto; }

.btn { display: inline-block; box-sizing: border-box; text-align: center; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; background: #1C2842; color: #F7F2EA; padding: 14px 22px; border: 1px solid #1C2842; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #B8923E; border-color: #B8923E; color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-outline { background: transparent; color: #1C2842; }
.btn-outline:hover { background: #1C2842; border-color: #1C2842; color: #F7F2EA; }
.btn-small { font-size: 11px; padding: 9px 14px; }
.link { background: transparent; border: 0; padding: 0; font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.link:hover { color: #B8923E; }
.danger { background: transparent; border: 0; padding: 0; color: #9A6B74; cursor: pointer; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }

/* Sign-in and account creation */
.auth { display: grid; place-items: center; padding: 32px 16px; box-sizing: border-box; }
.card { width: 100%; max-width: 420px; box-sizing: border-box; background: #fff; border: 1px solid #E6DDD0; padding: 36px 32px; display: flex; flex-direction: column; gap: 24px; }
.card h1 { margin-bottom: 20px; }
.card input { font-size: 16px; }
.card form { display: flex; flex-direction: column; gap: 18px; }
.logo { width: 150px; height: auto; display: block; margin: 0 auto; }
.note { font-weight: 300; line-height: 1.6; color: #5E6473; margin: 0 0 20px; }
#view-loading { margin: 0; text-align: center; }
.hint { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 300; }
.msg { margin: 0; font-size: 14px; line-height: 1.5; color: #9A6B74; }
.msg.ok { color: #1C2842; }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 13px; }

/* Admin panel */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { background: #fff; border-right: 1px solid #E6DDD0; padding: 28px 22px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; height: 100dvh; box-sizing: border-box; }
.side-logo { width: 150px; height: auto; align-self: center; }
.side-nav { display: flex; flex-direction: column; gap: 4px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.side-nav button { display: flex; justify-content: space-between; gap: 10px; text-align: left; background: transparent; color: inherit; border: 0; padding: 12px 14px; cursor: pointer; letter-spacing: inherit; text-transform: inherit; font-size: inherit; white-space: nowrap; }
.side-nav button.on { background: #F2EDE4; }
.count { opacity: .6; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12px; text-align: center; }
.side-foot .btn { padding: 10px 14px; letter-spacing: .18em; }
.saved { opacity: .55; }
.who { overflow-wrap: anywhere; color: #5E6473; }

.main { padding: 40px 48px 80px; max-width: 980px; width: 100%; box-sizing: border-box; }
.head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.help, .empty { font-weight: 300; color: #5E6473; margin: 0 0 20px; line-height: 1.6; }
.box { background: #fff; border: 1px solid #E6DDD0; padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full { grid-column: 1 / -1; }
.row-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; line-height: 1.2; }
.meta { font-size: 12px; color: #5E6473; letter-spacing: .1em; }

.orders { display: flex; flex-direction: column; gap: 16px; }
.order { background: #fff; border: 1px solid #E6DDD0; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.order.done { opacity: .55; }
.order-msg { margin: 0; font-weight: 300; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.contact { font-weight: 500; overflow-wrap: anywhere; }
a.contact { border-bottom: 1px solid #B8923E; }

.editor { margin-bottom: 32px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 96px; height: 96px; border: 1px solid #E6DDD0; }
.thumb img, .tile img, .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.remove { position: absolute; top: 6px; right: 6px; background: #F7F2EA; color: #1C2842; border: 0; width: 28px; height: 28px; padding: 0; cursor: pointer; font-size: 16px; line-height: 1; }
.check { flex-direction: row; align-items: center; gap: 10px; }
.editor-actions { display: flex; gap: 12px; justify-content: flex-end; }
.post-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid #D9CFC0; }
.cover { width: 72px; height: 72px; background: #E8DACB; overflow: hidden; }

.add-photos { flex-direction: row; cursor: pointer; }
.add-photos input { display: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.tile-wrap { display: flex; flex-direction: column; gap: 8px; }
.tile { aspect-ratio: 1; background: #E8DACB; overflow: hidden; position: relative; }

.faqs { display: flex; flex-direction: column; gap: 16px; }
.faq-box { background: #fff; border: 1px solid #E6DDD0; padding: 22px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: start; }
.faq-box .danger { padding-top: 26px; }
.faq-box .answer-es { grid-column: 1 / 2; }
.faq-box .answer-en { grid-column: 2 / 3; }

@media (max-width: 760px) {
  input, textarea { font-size: 16px; }
  .app { display: block; }
  .side { position: sticky; z-index: 5; height: auto; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 0 0; border-right: 0; border-bottom: 1px solid #E6DDD0; }
  .side-logo { display: none; }
  .side-nav { flex-direction: row; justify-content: space-between; gap: 0; overflow-x: auto; padding: 0 8px; font-size: 12px; letter-spacing: .08em; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav button { padding: 12px 8px; gap: 6px; border-bottom: 2px solid transparent; }
  .side-nav .count:not(#n-orders) { display: none; }
  .side-nav button.on { background: transparent; border-bottom-color: #B8923E; }
  .side-foot { order: -1; margin: 0; padding: 0 16px; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .side-foot .btn { border: 0; padding: 0; background: transparent; color: inherit; font-size: 11px; }
  .who span { display: none; }
  .main { padding: 28px 16px calc(64px + env(safe-area-inset-bottom)); }
  h1 { font-size: 34px; }
  .box { grid-template-columns: 1fr; padding: 20px; }
  .faq-box { grid-template-columns: 1fr; padding: 18px; }
  .faq-box .answer-es, .faq-box .answer-en { grid-column: auto; }
  .faq-box .danger { padding-top: 0; justify-self: start; order: 5; }
  .post-row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px 14px; }
  .cover { width: 56px; height: 56px; }
  .post-row .btn-small { grid-column: 2; justify-self: start; }
  .post-row .danger { grid-column: 2; justify-self: start; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Atelier admin · mobile app */
:root { --ink: #1c2842; --rose: #9a6b74; --cream: #f7f2ea; --border: #e9e1d6; }
* { box-sizing: border-box; }
body { background: var(--cream); }
button, a, input, label { -webkit-tap-highlight-color: transparent; }
button, .btn { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid #b8923e; outline-offset: 4px; }
.btn { border-radius: 12px; min-height: 44px; letter-spacing: .1em; font-size: 11px; font-weight: 500; }
input, textarea { border-radius: 12px; border-color: var(--border); padding: 14px; font-size: 16px; }
label { letter-spacing: .1em; line-height: 1.5; }
.card { border-radius: 26px; box-shadow: 0 20px 70px #1c28420a; border-color: var(--border); }
.card .logo { width: 132px; }
.card .links .link, .card .links a { min-height: 44px; display: flex; align-items: center; }
.mobile-brand { display: flex; align-items: center; gap: 10px; }
.mobile-brand img { object-fit: contain; }
.mobile-brand strong { display: block; font-family: 'Cormorant Garamond',serif; font-size: 28px; font-weight: 500; line-height: 1; }
.mobile-brand span { display: block; color: #7b7e88; font-size: 10px; margin-top: 5px; letter-spacing: .05em; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; font-size: 26px; }
.mobile-brand .icon-button { margin-left: auto; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side-logo { display: none; }
.side { border-color: var(--border); padding: 26px 18px; }
.side-nav button { align-items: center; justify-content: flex-start; border-radius: 12px; min-height: 50px; letter-spacing: .04em; text-transform: none; font-size: 14px; }
.side-nav button.on { background: #f6f0e8; color: var(--ink); }
.side-nav .count { margin-left: auto; background: #eee5d7; padding: 2px 7px; border-radius: 20px; font-size: 10px; opacity: 1; }
.side-nav .count:empty { display: none; }
.who .link { padding: 12px 4px; }
.workspace { min-width: 0; }
.connection { font-size: 11px; color: #687d70; padding: 24px 48px 0; display: flex; align-items: center; gap: 7px; }
.connection::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.connection.offline { color: #9a6b74; }
.main { padding-top: 22px; }
.head { align-items: center; margin-bottom: 24px; }
.head h1 { font-size: 42px; }
.help { font-size: 14px; }
.order-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.stat { border-radius: 18px; padding: 20px; background: #fff; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.stat:first-child { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat strong { font-family: 'Cormorant Garamond',serif; font-size: 38px; font-weight: 500; line-height: 1; }
.stat span { font-size: 12px; opacity: .75; }
.order-tools { display: grid; gap: 14px; margin-bottom: 20px; }
.search-label { font-size: 0; }
.search-label input { font-size: 16px; background: #fff; }
.filters { display: flex; gap: 6px; background: #ece6dd; padding: 4px; border-radius: 12px; }
.filters button { flex: 1; border: 0; border-radius: 9px; padding: 11px; color: #686976; background: transparent; font-size: 13px; cursor: pointer; min-height: 44px; }
.filters button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px #1c284208; }
.order { border-radius: 18px; padding: 22px; gap: 16px; box-shadow: 0 3px 12px #1c284203; }
.order.done { opacity: 1; background: #fcfaf6; }
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order .row-title { font-family: 'Jost',sans-serif; font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.order .meta { font-size: 11px; letter-spacing: 0; margin-top: 4px; line-height: 1.6; }
.status-pill { background: #f6e9df; color: #8b6350; border-radius: 20px; font-size: 10px; padding: 5px 10px; white-space: nowrap; }
.done .status-pill { background: #e9efe8; color: #5c7561; }
.order-msg { font-size: 14px; color: #606776; line-height: 1.65; }
.order-foot { padding-top: 14px; border-top: 1px solid #f1ece5; }
.contact { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
.box, .faq-box { border-radius: 18px; border-color: var(--border); }
.empty { text-align: center; padding: 36px 24px; border: 1px dashed #d8ccbb; border-radius: 18px; background: #ffffff80; font-size: 14px; }
.tile, .cover, .thumb { border-radius: 14px; }
.remove { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 2px 8px #1c284220; }
.danger { min-height: 44px; padding: 10px; }
.post-row { background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 12px; padding: 16px; }
.settings-dialog { width: min(480px, calc(100% - 24px)); max-height: 90dvh; overflow-y: auto; border: 1px solid var(--border); border-radius: 26px; padding: 26px; color: var(--ink); background: var(--cream); }
.settings-dialog::backdrop { background: #1c28426b; backdrop-filter: blur(5px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
h2 { font-family: 'Cormorant Garamond',serif; font-weight: 500; font-size: 32px; margin: 0; }
.setting-card { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: white; margin-bottom: 12px; }
.setting-card h3 { font-size: 15px; margin: 0 0 8px; font-weight: 500; }
.setting-card p, .settings-note { font-size: 13px; line-height: 1.6; color: #69717e; margin: 0 0 14px; }
.setting-card .btn { width: 100%; white-space: normal; }
.setting-card .link { min-height: 44px; margin-top: 8px; font-size: 13px; color: var(--rose); width: 100%; }
.settings-note { margin: 18px 4px 0; font-size: 11px; }
.update-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin: 18px 48px 0; border-radius: 14px; background: #ece3d3; font-size: 13px; }
.update-banner span { display: block; font-size: 11px; margin-top: 4px; color: #626675; }
.toast { position: fixed; z-index: 40; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: min(440px, calc(100% - 32px)); width: max-content; border-radius: 14px; padding: 16px 22px; background: var(--ink); color: white; box-shadow: 0 10px 30px #1c28422b; font-size: 13px; }
@media (max-width: 760px) {
  .auth { padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)); }
  .card { padding: 30px 24px; }
  .side { padding: calc(12px + env(safe-area-inset-top)) 20px 10px; background: #f7f2eaf5; backdrop-filter: blur(18px); gap: 0; border-bottom: 1px solid var(--border); }
  .mobile-brand { width: 100%; }
  .side-nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--border); justify-content: space-around; overflow: visible; }
  .side { backdrop-filter: none; } /* A transformed backdrop would contain the fixed tab bar. */
  .side-nav button { position: relative; flex: 1; flex-direction: column; justify-content: center; gap: 5px; padding: 7px 2px; min-height: 54px; border: 0; font-size: 10px; border-radius: 10px; color: #9396a0; }
  .side-nav button.on { color: var(--ink); background: #f7f2ea; border: 0; }
  .side-nav svg { width: 21px; height: 21px; }
  .side-nav .count { position: absolute; top: 1px; right: 14%; background: var(--rose); color: white; font-size: 9px; padding: 2px 5px; min-width: 16px; }
  .side-foot { order: initial; padding: 0; margin-top: 9px; gap: 8px; font-size: 10px; }
  .side-foot .btn { min-height: 30px; display: flex; align-items: center; font-size: 9px; letter-spacing: .06em; }
  .side-foot .who .link { min-height: 30px; padding: 6px 0; }
  .saved { font-size: 9px; opacity: .7; }
  .connection { padding: 18px 20px 0; font-size: 10px; }
  .main { padding: 18px 20px calc(108px + env(safe-area-inset-bottom)); }
  .head h1 { font-size: 36px; }
  .head .eyebrow { font-size: 9px; letter-spacing: .2em; }
  .order-summary { gap: 10px; margin-bottom: 20px; }
  .stat { padding: 18px; }
  .stat strong { font-size: 34px; }
  .order { padding: 18px; }
  .order-foot .btn { padding: 11px 14px; }
  .order-foot .contact { max-width: 100%; }
  .update-banner { margin: 14px 20px 0; padding: 14px; }
  .settings-dialog { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 26px 26px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* On phones, keep the app frame still and scroll only its content. */
@media (max-width: 760px) {
  html { overscroll-behavior: none; }
  body { touch-action: pan-y; overscroll-behavior: none; }
  body:not(.auth) { height: 100dvh; overflow: hidden; }
  .app { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
  .side { position: relative; top: auto; flex: 0 0 auto; }
  .side-nav { touch-action: manipulation; }
  .workspace { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
  .settings-dialog { overscroll-behavior: contain; touch-action: pan-y; }
}

/* Quiet feedback: animations never shift the app frame or delay real content. */
@keyframes atelier-spin { to { transform: rotate(360deg); } }
@keyframes atelier-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
.loading-welcome { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 6px; }
.loading-welcome .loading-label { font-size: 14px; color: #69717e; }
.loading-ring, .is-loading::after, .is-working::before { border: 2px solid #b8923e35; border-top-color: #b8923e; border-radius: 50%; animation: atelier-spin 1s linear infinite; }
.loading-ring { display: block; width: 28px; height: 28px; }
.is-loading { position: relative; color: transparent !important; }
.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; left: calc(50% - 10px); top: calc(50% - 10px); }
.is-working { display: inline-flex; align-items: center; gap: 6px; }
.is-working::before { content: ''; width: 9px; height: 9px; flex: 0 0 9px; }
.loading-caption { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; color: #69717e; font-size: 13px; }
.loading-caption .loading-ring { width: 16px; height: 16px; }
.skeleton { background: linear-gradient(100deg, #eae3d9 25%, #f6f2ec 45%, #eae3d9 65%); background-size: 220% 100%; animation: atelier-shimmer 2.2s ease-in-out infinite; border-radius: 7px; }
.skeleton-card { background: #ffffffb8; border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 16px; }
.skeleton-title { width: 44%; height: 20px; margin-bottom: 12px; }
.skeleton-line { height: 12px; margin-bottom: 10px; }
.skeleton-line.short { width: 66%; }
.skeleton-action { height: 42px; width: 112px; margin: 24px 0 0 auto; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) {
  .loading-ring, .is-loading::after, .is-working::before, .skeleton { animation: none; }
}
