@import url('/assets/brand.css');
@import url('/assets/pin.css');

:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.35;
  color: #0d294d;
  background: #eaf1f9;
  --text: #0d294d;
  --blue: #0755ce;
  --blue-dark: #063d9a;
  --green: #13a66f;
  --green-soft: #e7f8f1;
  --yellow: #ffd84d;
  --surface: #ffffff;
  --page: #eaf1f9;
  --line: #d7e0eb;
  --muted: #6f7f94;
  --navy: #0b2343;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: linear-gradient(155deg, #f7faff 0%, #e6eef8 58%, #d8e5f3 100%); }
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .46; cursor: default; }
button:not(:disabled):active { transform: translateY(1px); filter: brightness(.97); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #3a80ef; outline-offset: 3px; }
a { color: inherit; }
input { min-width: 0; }
button .icon { pointer-events: none; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.skip { position: fixed; top: -100px; left: 12px; z-index: 30; padding: 12px; border-radius: 8px; background: #fff; color: #111; }
.skip:focus { top: 12px; }

.remote {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 450px;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.remote::before, .remote::after { content: ''; position: absolute; z-index: -1; pointer-events: none; border-radius: 20px; transform: rotate(-4deg); }
.remote::before { width: 250px; height: 170px; top: -70px; right: -85px; background: var(--yellow); }
.remote::after { width: 220px; height: 90px; left: -95px; bottom: 85px; background: #0a4fc2; opacity: .12; transform: rotate(8deg); }

.remote-header { min-height: 42px; display: flex; align-items: center; gap: 10px; }
.wordmark { margin-right: auto; display: flex; align-items: center; gap: 9px; min-width: 0; }
.wordmark .baxoon-logo { width: 118px; height: auto; display: block; padding: 3px 4px; border-radius: 5px; background: #fff; }
.wordmark small { padding-left: 9px; border-left: 1px solid #bfcada; color: #52657c; font-size: .62rem; font-weight: 800; line-height: 1.2; letter-spacing: .1em; }
.connect-button { min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #c8d4e2; border-radius: 10px; background: #fff; color: #174574; font-size: .78rem; font-weight: 750; box-shadow: 0 5px 16px #16395b12; }

.preview { min-width: 0; padding: 5px; border-radius: 17px; background: #0a1e3b; box-shadow: 0 13px 30px #153d6826; }
.preview-caption { min-height: 21px; padding: 4px 7px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #c3d1e4; font-size: .66rem; }
.preview-caption > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-caption > span:last-child { flex: none; }
.sign { min-height: 111px; padding: 7px 10px; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid #ffe680; border-radius: 12px; background: var(--yellow); color: #112749; }
.sign-top, .sign-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .56rem; line-height: 1.1; }
.sign-brand { font-weight: 850; letter-spacing: .1em; }
.sign-branch { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-footer { display: flex; align-items: center; }
.sign-footer .baxoon-sign-logo { width: 63px; height: auto; padding: 2px 3px; border-radius: 3px; background: #fff; }
.sign-main { min-width: 0; padding: 2px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.sign-eyebrow { display: none; }
.sign-title { font-size: 1.48rem; font-weight: 900; line-height: 1; letter-spacing: -.045em; }
.sign-message { max-width: 100%; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .61rem; }
.sign-timer { font-size: 1.5rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.02; letter-spacing: -.04em; }
.sign-timer:empty, .sign-return:empty { display: none; }
.sign-return { margin-top: 1px; font-size: .58rem; font-weight: 650; }
.sign-open { border-color: #b6e2cc; background: #dff5ea; color: #163e31; }
.sign-closed { border-color: #c5d3e5; background: #e1e9f4; color: #203550; }
.sign-unknown { border-color: #405879; background: #263b58; color: #edf3fb; }
.sign-pending .sign-title { font-size: 1.34rem; }

.controls { min-width: 0; padding: 12px 13px 11px; display: flex; flex-direction: column; gap: 7px; border: 1px solid #dbe4ee; border-radius: 22px; background: #fff; box-shadow: 0 19px 42px #15395f24; }
.controller-heading { min-height: 38px; display: grid; grid-template-columns: 11px minmax(0, 1fr) 38px; align-items: center; gap: 8px; }
.connection-dot { width: 10px; height: 10px; border-radius: 50%; background: #a6b1bf; box-shadow: 0 0 0 4px #a6b1bf1d; }
.connection-dot[data-kind="live"], .connection-dot[data-kind="demo"] { background: #20bf83; box-shadow: 0 0 0 4px #20bf8320; }
.connection-dot[data-kind="offline"], .connection-dot[data-kind="cached"], .connection-dot[data-kind="reconnecting"] { background: #eca51d; box-shadow: 0 0 0 4px #eca51d1f; }
.connection-dot[data-kind="missing"], .connection-dot[data-kind="error"] { background: #d55050; box-shadow: 0 0 0 4px #d550501f; }
.controller-identity { min-width: 0; }
.controller-identity h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #12345d; font-size: .9rem; font-weight: 800; line-height: 1.15; }
.controller-identity > span { display: block; margin-top: 2px; color: #7d8ba0; font-size: .66rem; line-height: 1.1; }
.more-button { width: 38px; min-width: 38px; min-height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #174574; font-size: .88rem; font-weight: 900; letter-spacing: .08em; }
.more-button:hover { background: #f0f5fa; }
.controller-rule { height: 1px; margin: 1px 0 2px; background: #dce4ed; }
.control-label, .break-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.control-label h2, .break-heading h2 { color: #66778d; font-size: .7rem; font-weight: 750; }
.control-label > span, .break-heading > span { color: #9aa7b7; font-size: .61rem; }

.status-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.status-button { position: relative; min-height: 43px; padding: 5px 8px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d2dce8; border-radius: 9px; background: #fff; color: #17375e; font-size: .79rem; }
.status-button .icon { width: 15px; height: 15px; }
.status-button.open { border-color: #bfe6d4; background: var(--green-soft); color: #11865c; }
.status-button.closed { background: #fbfcfe; }
.status-button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
.selected-mark { position: absolute; top: 3px; right: 6px; visibility: hidden; font-size: .64rem; }
.status-button[aria-pressed="true"] .selected-mark { visibility: visible; }

.break-heading { margin-top: 1px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.presets button { min-width: 0; min-height: 47px; padding: 5px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid #d2dce8; border-radius: 9px; background: #fff; color: #12365f; }
.presets button > span { display: flex; align-items: center; gap: 3px; color: #7b899b; font-size: .58rem; line-height: 1.05; }
.presets .icon { width: 11px; height: 11px; }
.presets strong { order: -1; color: #17375e; font-size: .77rem; font-weight: 800; }
.presets button[data-minutes="10"] { border-color: #f0c83d; background: #fff9dc; box-shadow: inset 0 0 0 1px #ffe27c; }

.custom-away { display: grid; grid-template-columns: minmax(130px, .9fr) minmax(110px, 1.1fr); gap: 7px; }
.stepper { min-width: 0; min-height: 43px; display: flex; align-items: center; border: 1px solid #d2dce8; border-radius: 9px; background: #f7f9fc; }
.stepper button { min-width: 38px; min-height: 41px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #174574; font-size: 1.2rem; }
.stepper label { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.stepper input { width: 3ch; padding: 0; appearance: textfield; border: 0; background: transparent; color: #0d294d; text-align: center; font-size: .78rem; font-weight: 800; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; }
.stepper label > span { color: #7f8da0; font-size: .63rem; }
.away-button { min-height: 43px; padding: 5px 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--blue); border-radius: 9px; background: linear-gradient(135deg, #0a62df, #084abb); color: #fff; font-size: .78rem; font-weight: 800; box-shadow: 0 6px 14px #0755ce20; }
.away-button .icon { width: 15px; height: 15px; }

.secondary-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.secondary-controls button { position: relative; min-width: 0; min-height: 42px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid #dbe3ed; border-radius: 9px; background: #f8fafc; color: #53677f; font-size: .58rem; font-weight: 700; }
.secondary-controls .icon { width: 15px; height: 15px; }
.secondary-controls button[aria-pressed="true"] { border-color: #80c9ad; background: #e9f8f2; color: #12865d; }
#voice-button[data-armed="true"] { border-color: #e9bd29; background: var(--yellow); color: #17355d; }
#inbox { order: 3; }
#lock { order: 4; }
#unread { position: absolute; top: -5px; right: 1px; min-width: 18px; padding: 2px 4px; border-radius: 12px; background: #d0343b; color: #fff; font-size: .58rem; line-height: 1.3; }

.status-summary { min-height: 39px; padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 9px; background: linear-gradient(135deg, #0961dd, #0648b5); color: #fff; font-size: .75rem; font-weight: 700; box-shadow: 0 8px 18px #0755ce25; }
.status-summary[data-kind="open"] { background: linear-gradient(135deg, #16aa75, #0f875e); }
.status-summary[data-kind="closed"] { background: linear-gradient(135deg, #234267, #112a4b); }
.status-summary[data-kind="unknown"] { background: #8290a3; }
.feedback-row { min-height: 20px; display: flex; align-items: flex-start; gap: 7px; color: #7b899c; font-size: .64rem; line-height: 1.35; }
.feedback-row p { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.feedback-row[data-error="true"] { color: #a45d00; }
.feedback-row button { min-height: 28px; padding: 3px 8px; border: 1px solid #cfd9e5; border-radius: 7px; background: #fff; color: #174574; font-size: .63rem; }
.remote[data-busy="true"] #notice { color: #a16c00; }

dialog { width: calc(100% - 20px); max-width: 430px; max-height: calc(100svh - 24px); margin: auto auto max(10px, env(safe-area-inset-bottom)); padding: 20px; overflow: auto; border: 1px solid #d5e0eb; border-radius: 20px; background: #fff; color: #153353; box-shadow: 0 24px 80px #08213e61; }
dialog::backdrop { background: #071a35a6; backdrop-filter: blur(4px); }
.modal-heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-heading h2 { color: #0e2d52; font-size: 1.2rem; line-height: 1.2; }
.modal-heading .icon-button { width: 42px; min-width: 42px; min-height: 42px; display: grid; place-items: center; border: 1px solid #d8e1ec; border-radius: 10px; background: #f6f8fb; }
.muted { margin: 10px 0 16px; color: #6e7e92; font-size: .875rem; line-height: 1.5; }
.field { margin: 14px 0; display: flex; flex-direction: column; gap: 6px; color: #415873; font-size: .875rem; }
.field input, dialog > input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #c9d5e2; border-radius: 10px; background: #f8fafc; color: #102f53; font-size: 1rem; }
.field input::placeholder { color: #94a1b1; }
.checkbox-row { min-height: 44px; margin: 8px 0; display: flex; align-items: center; gap: 10px; color: #415873; font-size: .875rem; }
.checkbox-row input { width: 20px; height: 20px; flex: none; accent-color: var(--blue); }
.form-feedback { margin: 12px 0; color: #a25300; font-size: .875rem; overflow-wrap: anywhere; }
.form-feedback:empty { display: none; }
.button { min-height: 48px; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #cfd9e4; border-radius: 10px; background: #f7f9fc; color: #17375e; font-weight: 700; }
.full { width: 100%; }
.button-primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.sheet-actions { margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sheet-actions button, .sheet-actions a { min-height: 48px; padding: 9px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d4deea; border-radius: 10px; background: #f7f9fc; color: #17375e; font-size: .8rem; text-decoration: none; }
.install-help, .voice-guide { margin-top: 16px; padding-top: 16px; border-top: 1px solid #dce4ed; }
.sheet-note { margin-top: 12px; color: #6e7e92; font-size: .8rem; line-height: 1.5; }
.voice-guide ul { margin: 12px 0; padding-left: 20px; color: #405975; font-size: .8rem; line-height: 1.65; }
.toast { max-width: 400px; margin: auto; padding: 12px 16px; border-radius: 12px; background: #fff; color: #17355b; box-shadow: 0 8px 30px #0b274d4a; font-size: .875rem; }
.toast-error { background: #fff0d7; }
#toasts { position: fixed; z-index: 40; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; display: grid; gap: 6px; pointer-events: none; }
.noscript { padding: 20px; }
.mobile-message { padding: 16px 0; border-bottom: 1px solid #d9e0e7; }
.mobile-message header { display: grid; gap: 5px; }
.mobile-message time { color: #718096; font-size: .7rem; }
.mobile-message p { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.mobile-message > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mobile-message button { padding: 9px 12px; border: 1px solid #cfd9e3; border-radius: 9px; background: #f4f7fa; color: #153353; }
.mobile-message.is-read { opacity: .66; }

@media (min-width: 560px) {
  body { padding: 18px 0; }
  .remote { min-height: calc(100svh - 36px); border: 1px solid #d3deea; border-radius: 28px; background: #eef4fb; box-shadow: 0 30px 90px #0a2a4f26; }
}

@media (max-height: 700px) {
  .remote { gap: 6px; padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .remote-header { min-height: 36px; }
  .wordmark .baxoon-logo { width: 108px; }
  .preview { padding: 4px; }
  .sign { min-height: 92px; padding: 5px 9px; }
  .sign-title { font-size: 1.3rem; }
  .sign-timer { font-size: 1.32rem; }
  .preview-caption { min-height: 17px; padding-top: 2px; }
  .controls { gap: 5px; padding-top: 9px; padding-bottom: 8px; }
  .controller-heading { min-height: 32px; }
  .status-button, .stepper, .away-button { min-height: 39px; }
  .stepper button { min-height: 37px; }
  .presets button { min-height: 42px; }
  .secondary-controls button { min-height: 38px; }
  .status-summary { min-height: 35px; }
}

@media (max-width: 350px) {
  .remote { padding-right: max(9px, env(safe-area-inset-right)); padding-left: max(9px, env(safe-area-inset-left)); }
  .wordmark small { display: none; }
  .wordmark .baxoon-logo { width: 105px; }
  .connect-button { padding: 0 8px; }
  .controls { padding-right: 10px; padding-left: 10px; }
  .control-label > span, .break-heading > span { display: none; }
  .presets button > span .icon { display: none; }
  .custom-away { grid-template-columns: minmax(120px, .9fr) minmax(100px, 1.1fr); }
}

@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active { transform: none; }
}
