:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ink: #1d1d1f;
  --muted: #54545b;
  --surface: #fff;
  --background: #f5f5f7;
  --line: #dedee4;
  --blue: #005fcc;
  --blue-dark: #004daa;
  --blue-soft: #eaf3ff;
  --green: #265a1b;
  --green-soft: #edf6e8;
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding: clamp(1rem, 3vw, 2.5rem); display: grid; place-items: center; background: var(--background); color: var(--ink); line-height: 1.5; }
main { width: min(100%, 29rem); padding: clamp(1.25rem, 4vw, 2.25rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 44px rgba(30, 31, 36, .06); }
header { text-align: center; }
header img { object-fit: contain; display: inline-block; vertical-align: middle; }
header p { margin: .45rem 0 1.25rem; font-size: 1.65rem; font-weight: 700; letter-spacing: -.04em; }
h1, h2 { margin-block: 0 .7rem; letter-spacing: -.025em; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.13rem; }
a { color: var(--blue); }
label { display: grid; gap: .38rem; min-width: 0; font-size: .94rem; font-weight: 550; }
input, select, button { min-width: 0; min-height: 44px; padding: .65rem .83rem; font: inherit; border-radius: 10px; }
input, select { display: block; width: 100%; max-width: 100%; border: 1px solid #a8a8b0; background: var(--surface); color: var(--ink); }
input:hover, select:hover { border-color: #707078; }
button { width: 100%; background: var(--blue); color: #fff; border: 0; cursor: pointer; font-weight: 600; }
button:hover { background: var(--blue-dark); }
button:disabled { opacity: .58; cursor: default; }
:focus-visible { outline: 3px solid #206dde; outline-offset: 3px; }
[role=alert] { padding: .75rem .9rem; border-radius: 10px; background: var(--blue-soft); }
.admin { display: block; padding: 0; }
.admin main { width: 100%; max-width: none; margin: 0; min-height: 100vh; padding: clamp(1rem, 3vw, 3.25rem); border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.admin-bar, .admin-bar div { display: flex; align-items: center; gap: .75rem; }
.admin-bar { justify-content: space-between; text-align: left; margin-bottom: 1.6rem; }
.admin h1 { font-size: clamp(1.65rem, 3.2vw, 2.65rem); margin-bottom: 1.3rem; }
.admin section { width: 100%; padding: clamp(1rem, 2vw, 1.7rem); margin: 1rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin section h2 { margin-bottom: 1rem; }
.admin button { width: auto; }
.secondary { background: var(--blue-soft); color: var(--blue-dark); }
.secondary:hover { background: #dceaff; }
.form-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem 1.25rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .72rem .65rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .88rem; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; background: var(--background); color: var(--muted); border-radius: 999px; padding: .2rem .55rem; font-size: .85rem; white-space: nowrap; }
.status.is-on { background: var(--green-soft); color: var(--green); }
.policy-inline { display: flex; align-items: center; gap: .55rem; }
@media (max-width: 540px) { .admin-bar img { width: 32px; height: 32px; } .admin-bar button { padding-inline: .6rem; } }

.company-controls { flex-wrap: wrap; justify-content: flex-end; }
.locale-picker, .locale-picker label { display: flex; align-items: center; gap: .45rem; }
.locale-picker select { width: auto; }
.company-role { color: var(--muted); margin: -.7rem 0 1.4rem; }
.company-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin .company-section-heading h2 { margin: 0; }
.app-button { display: inline-flex; background: var(--blue); color: #fff; border-radius: 10px; padding: .65rem .9rem; font-weight: 600; text-decoration: none; }
.app-button:hover { background: var(--blue-dark); }
.draft-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.draft-card { display: flex; align-items: flex-start; flex-direction: column; gap: .45rem; height: 100%; min-height: 7rem; border: 1px solid var(--line); border-radius: 12px; padding: .95rem; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.draft-card:hover { border-color: var(--blue); }
.draft-description { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.draft-pages { display: flex; gap: 1rem; margin-top: 1rem; }
.draft-title { margin-top: 1rem; }
.draft-form { display: grid; gap: 1rem; margin-top: 1rem; }
.draft-form button { justify-self: start; }
.draft-form textarea { resize: vertical; width: 100%; border: 1px solid #a8a8b0; border-radius: 10px; padding: .65rem .83rem; font: inherit; }
.draft-saved { color: var(--green); background: var(--green-soft); padding: .65rem .85rem; border-radius: 10px; }
@media (max-width: 640px) { .admin-bar { flex-wrap: wrap; } .company-controls { justify-content: flex-start; } }

.designer-tabs { display: flex; gap: .55rem; }
.designer-tabs a { padding: .55rem .8rem; border-radius: 9px; text-decoration: none; }
.designer-tabs a[aria-current=page] { background: var(--blue-soft); font-weight: 650; }
.designer-layout { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(16rem, 2fr) minmax(12rem, 1.2fr); gap: 1rem; }
.designer-layout > section { min-width: 0; }
.screen-designer { grid-template-columns: minmax(16rem, 2fr) minmax(12rem, 1fr); }
.designer-palette { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.designer-phone { width: min(100%,22rem); min-height: 22rem; margin: auto; border: 5px solid var(--ink); border-radius: 22px; background: var(--background); padding: 1.1rem; overflow-wrap: anywhere; }
#designer-preview { display: grid; gap: .45rem; margin-top: .75rem; }
.admin button.preview-field { width: 100%; display: grid; gap: .35rem; padding: .65rem; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.admin button.preview-field[aria-pressed=true] { outline: 2px solid var(--blue); outline-offset: -2px; }
.mock-input { display: block; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-weight: 400; }
#designer-properties { display: grid; gap: .65rem; }
#designer-properties input[type=checkbox] { width: 1.2rem; min-height: 1.2rem; }
#designer-properties textarea { width: 100%; font: inherit; }
.screen-sample { display: grid; gap: .45rem; }
.screen-sample div { border-radius: 8px; background: white; padding: .55rem; }
.sample-icons { grid-template-columns: repeat(2,1fr); }
.demo-map { display: grid; grid-template-columns: repeat(2,1fr); place-items: center; padding: 1.3rem; gap: 1rem; min-height: 12rem; color: var(--blue); border-radius: 10px; background: repeating-linear-gradient(40deg,#eaf3ff 0 28px,#f4f7f8 29px 35px); }
@media (max-width: 850px) { .designer-layout, .screen-designer { grid-template-columns: 1fr; gap: 0; } }

.field-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:.65rem; }
.admin .field-tiles button { display:grid; min-height:88px; justify-items:center; align-content:center; gap:.35rem; padding:.4rem; background:#eaf2ff; color:#124795; border:1px solid #d7e5fa; border-radius:14px; }
.admin .field-tiles button:hover { background:#dbeaff; }
.field-tiles span { font-size:1.4rem; line-height:1.2; }
.designer-phone { position:relative; width:min(100%,340px); min-height:510px; padding:2.6rem .85rem 2.1rem; border:8px solid #20252d; border-radius:38px; background:#f4f6fa; box-shadow:0 12px 30px #17223b26; }
.designer-phone::before,.designer-phone::after { content:''; position:absolute; left:50%; transform:translateX(-50%); background:#20252d; border-radius:99px; }
.designer-phone::before { top:.65rem; width:70px; height:14px; }
.designer-phone::after { bottom:.55rem; width:90px; height:4px; }
#designer-navigation { display:grid; margin-top:1rem; }

.designer-phone { border-width: 2px; }
.admin button.preview-page { display:grid; width:100%; text-align:left; gap:.2rem; overflow-wrap:anywhere; }
.designer-phone small { font-size:.75rem; font-weight:500; color:#50596a; overflow-wrap:anywhere; }

.designer-phone { width:min(100%,460px); }
.board-link-properties { display:grid; gap:.45rem; margin-block:.65rem; border:1px solid #d6dbe5; border-radius:.65rem; padding:.6rem; }
.board-links { display:flex; flex-wrap:wrap; justify-content:center; gap:.8rem .35rem; }
.admin .board-links > .board-link { display:grid; justify-items:center; align-content:start; text-align:center; flex:0 0 calc((100% - .7rem)/3); min-width:0; box-sizing:border-box; padding:.65rem .25rem; border-radius:.85rem; color:inherit; text-decoration:none; overflow-wrap:anywhere; }
.admin a.board-link:hover { background:#e7edf8; }
.board-link-icon,.board-link-glyph { width:min(100%,84px); aspect-ratio:1; object-fit:contain; }
.board-link-glyph { display:grid; place-items:center; font-size:clamp(2rem,5vw,4rem); line-height:1; }
.board-link-label { font-size:.85rem; margin-top:.4rem; }
.designer-phone-heading { display:flex; align-items:center; justify-content:space-between; gap:.65rem; margin-bottom:.65rem; }
.designer-phone-heading strong { min-width:0; overflow-wrap:anywhere; }
.designer-phone-arrows { display:flex; flex:none; gap:.3rem; }
.admin .designer-phone-arrows button { display:grid; place-items:center; width:36px; height:36px; min-height:0; padding:0; border-radius:50%; font-size:1.4rem; line-height:1; }
.action-slot-list { display:flex; flex-wrap:wrap; gap:.4rem; }
.preview-action-buttons { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); width:100%; align-self:start; align-content:start; gap:.35rem; }
.admin .preview-action-buttons > button { min-width:0; min-height:44px; height:auto; width:100%; padding:.55rem .25rem; white-space:normal; overflow-wrap:anywhere; }
.admin .action-slot-list button[aria-pressed=true] { outline:2px solid #005fc7; outline-offset:-2px; }
#designer-properties input[type=color] { display:block; width:4rem; min-height:2.3rem; padding:.2rem; }

.designer-phone { box-sizing:border-box; display:flex; flex-direction:column; width:min(100%,390px); aspect-ratio:390 / 844; min-height:0; height:auto; }
.designer-phone #designer-preview { flex:1 1 0; min-height:0; overflow:auto; }
.designer-phone #designer-navigation { flex:none; }
.icon-photo-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(72px,1fr)); gap:.4rem; margin-top:.5rem; }
.admin .icon-photo-gallery button { display:grid; justify-items:center; gap:.2rem; padding:.3rem; font-size:.7rem; overflow-wrap:anywhere; }
.icon-photo-gallery img { width:44px; height:44px; object-fit:contain; }
.icon-photo-gallery [aria-pressed=true] { outline:2px solid #005fc7; }

.draft-grid > li { position:relative; }
#app-quick-status:empty { display:none; }
.draft-grid > li:has(.draft-edit-button) .draft-card { padding-right:3.8rem; }
.admin .draft-edit-button { position:absolute; top:.75rem; right:.75rem; display:grid; place-items:center; width:2.5rem; height:2.5rem; min-height:0; padding:0; border-radius:50%; }
.draft-edit-button .fa-pencil-alt { display:block; width:1rem; height:1rem; background:currentColor; clip-path:polygon(0 77%,69% 8%,92% 31%,23% 100%,0 100%,0 77%,76% 1%,99% 24%,92% 31%,69% 8%); }
#app-quick-dialog { width:min(29rem,calc(100% - 2rem)); box-sizing:border-box; border:1px solid #d6dbe5; border-radius:1rem; padding:1.25rem; color:inherit; }
#app-quick-dialog::backdrop { background:#18233880; }
#app-quick-dialog form { display:grid; gap:.75rem; }
#app-quick-dialog h2,#app-quick-dialog p { margin:0; }
.app-quick-actions { display:flex; justify-content:flex-end; gap:.5rem; }

body.admin.company-home { background:#fff; }
.company-home .admin-bar { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.75rem 1rem; }
.company-home .admin-bar .company-toolbar-identity { display:block; min-width:0; text-align:center; overflow-wrap:anywhere; }
.company-home .company-toolbar-identity h1 { margin:0; font-size:1.25rem; line-height:1.2; }
.company-home .company-toolbar-identity p { display:flex; flex-wrap:wrap; justify-content:center; column-gap:.65rem; margin:.2rem 0 0; color:#50545d; font-size:.85rem; }
@media(max-width:760px) {
 .company-home .admin-bar { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .company-home .admin-bar .company-controls { grid-column:1/-1; justify-content:flex-end; }
}
@media(max-width:420px) { .company-home .admin-bar .company-controls { justify-content:flex-start; flex-wrap:wrap; } }

.company-profile-heading {display:flex;justify-content:center;align-items:center;gap:.8rem;}
.company-home .company-profile-heading p {font-size:1.15rem;font-weight:700;color:#20242a;margin:0 0 .15rem;}
.company-home .company-profile-heading h1 {color:#0068d9;font-size:1.15rem;}
.company-avatar {position:relative;display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:50%;background:#eaf0fb;color:#31527d;overflow:hidden;cursor:pointer;}
.company-avatar input,.company-avatar img {position:absolute;inset:0;width:100%;height:100%;margin:0;}
.company-avatar input {opacity:0;cursor:pointer;}
.company-avatar img {object-fit:cover;pointer-events:none;}
.company-avatar:focus-within {outline:2px solid #005fc7;outline-offset:2px;}
.company-avatar-status {font-size:.8rem;}
.company-settings {position:relative;}
.company-settings summary,.company-support,.admin button.company-signout {display:grid;place-items:center;width:40px;height:40px;min-height:0;padding:0;border-radius:9px;cursor:pointer;color:#273344;background:transparent;}
.company-settings summary::-webkit-details-marker {display:none;}
.company-settings summary:hover,.company-support:hover,.admin button.company-signout:hover {background:#eef3fa;}
.admin button.company-signout {color:#d5243d;}
.company-settings .locale-picker {position:absolute;right:0;top:calc(100% + .4rem);z-index:4;padding:.6rem;background:white;border:1px solid #d8deea;border-radius:.65rem;box-shadow:0 6px 18px #23314b24;}
.company-settings[open] summary svg,.company-settings summary:hover svg {animation:company-gear-spin .65s ease;}
@keyframes company-gear-spin {to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.company-settings summary svg {animation:none!important;}}

body.admin.company-workshop {background:#fff;}
.company-workshop .admin-bar {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.75rem 1rem;}
.company-workshop .admin-bar .company-toolbar-identity {display:block;min-width:0;text-align:center;overflow-wrap:anywhere;}
.company-profile-heading > div {display:grid;gap:.15rem;text-align:center;}
.admin .company-profile-heading p,.admin .company-profile-heading h1 {display:block;font-size:1rem;font-weight:400;line-height:1.25;margin:0;letter-spacing:normal;}
.admin .company-profile-heading h1 {color:#0068d9;}
.company-avatar img[hidden] {display:none;}
.component-table-wrap {overflow-x:auto;}
.component-table {width:100%;border-collapse:collapse;text-align:left;}
.component-table th,.component-table td {padding:.75rem;border-bottom:1px solid #e3e8f0;white-space:nowrap;}
.component-table th {font-size:.85rem;color:#47546b;}
.component-title {display:flex;gap:.65rem;align-items:center;text-decoration:none;}
.component-title small {display:block;margin-top:.2rem;color:#536070;}
.component-icon {display:grid;place-items:center;width:38px;height:38px;background:#eff4fc;border-radius:.55rem;font-size:1.25rem;}
@media(max-width:760px){.company-workshop .admin-bar {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}.company-workshop .admin-bar .company-controls {grid-column:1/-1;justify-content:flex-end;}}

.workshop-index {display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,23%);gap:1rem;align-items:start;}
.admin .workshop-index > .workshop-catalog { margin-top: 0; }
.admin .workshop-catalog .component-icon {
  box-sizing: border-box; min-width: 38px; min-height: 38px; padding: 0;
  border: 0; overflow: hidden; background: transparent; position: relative;
}
.admin .workshop-catalog .component-icon > img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover;
}
.workshop-folders {border:1px solid #dce2ea;border-radius:1rem;padding:1rem;min-width:0;}
.workshop-folders h2 {margin:0 0 .55rem;font-size:1rem;}
.workshop-folders nav {display:grid;gap:.15rem;}
.workshop-folders nav a {padding:.55rem .6rem;border-radius:.5rem;text-decoration:none;overflow-wrap:anywhere;}
.workshop-folders nav a[aria-current=page] {background:#e8f1ff;font-weight:600;}
.workshop-index summary {cursor:pointer;color:#0057b8;}
.workshop-index details {margin-top:.7rem;}
.workshop-index details form {display:grid;gap:.55rem;padding:.65rem 0;}
.workshop-index fieldset {min-width:0;border:1px solid #dce2ea;border-radius:.5rem;}
.folder-options {max-height:180px;overflow:auto;}
.folder-options label {display:flex;align-items:baseline;gap:.4rem;overflow-wrap:anywhere;}
.folder-options input[type=checkbox] {width:auto;min-height:0;flex:none;}
@media(max-width:850px){.workshop-index {grid-template-columns:minmax(0,1fr);}}

.folder-row {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.4rem;}
.admin button.folder-icon-button {width:2rem;height:2rem;min-height:0;padding:0;display:grid;place-items:center;font-size:1.15rem;line-height:1;border-radius:.5rem;}
.folder-popover {width:min(440px,calc(100% - 2rem));box-sizing:border-box;max-height:85vh;overflow:auto;padding:1rem;border:1px solid #dce2ea;border-radius:1rem;box-shadow:0 12px 40px #18314b35;}
.folder-popover::backdrop {background:#18233855;}
.folder-popover-heading {display:flex;justify-content:space-between;align-items:center;gap:1rem;}
.folder-popover-heading h3 {margin:0;}
.workshop-index .folder-popover form {display:grid;gap:.65rem;padding:.65rem 0 0;}
.admin .workshop-catalog button[popovertarget="workshop-create-popup"]:not([popovertargetaction]) { background:transparent; color:#0057b8; border:0; box-shadow:none; font-weight:500; padding:.55rem .75rem; border-radius:.55rem; }
.admin .workshop-catalog button[popovertarget="workshop-create-popup"]:not([popovertargetaction]):hover { background:#e8f1ff; }

.workshop-name-cell {display:flex;align-items:center;gap:.45rem;}
.workshop-name-cell .folder-popover {white-space:normal;}

.designer-compact-bar {display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.75rem;}
.designer-compact-bar + input ~ .designer-layout {margin-top:0;}

.admin button.workshop-name-pencil {display:inline-grid;place-items:center;flex:none;min-height:0;width:1.5rem;height:1.5rem;padding:0;border:0;border-radius:.3rem;box-shadow:none;background:transparent;color:#64748b;}
.admin button.workshop-name-pencil:hover {color:#0057b8;background:#edf3fc;}

.admin .designer-compact-bar {justify-content:flex-end;}
.admin .designer-compact-bar .designer-back-button {display:inline-flex;align-items:center;justify-content:center;align-self:stretch;padding:.55rem .85rem;background:#eaf2ff;color:#0057b8;text-decoration:none;border-radius:.65rem;}
.admin .designer-compact-bar .designer-back-button:hover {background:#dbeaff;}

.preview-field-heading {display:flex;justify-content:space-between;align-items:baseline;gap:.55rem;min-width:0;text-align:left;}
.preview-field-heading > * {min-width:0;overflow-wrap:anywhere;}
.designer-phone .preview-field-heading small {text-align:right;color:#187646;}

.admin .admin-bar:has(.company-toolbar-identity) {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;}
.admin .admin-bar .company-toolbar-identity {grid-column:2;}
.admin .admin-bar .company-controls {justify-self:end;}
.admin .company-profile-heading {display:grid;grid-template-columns:48px minmax(0,auto) 48px;}
.admin .company-profile-heading::before {content:"";}
.admin .company-controls .designer-compact-bar {margin:0;gap:.4rem;align-items:center;}
@media(max-width:1050px){.admin .admin-bar:has(.company-toolbar-identity){grid-template-columns:minmax(0,1fr);justify-items:center;gap:.65rem;}.admin .admin-bar .company-toolbar-identity,.admin .admin-bar .company-controls{grid-column:1;justify-self:center;}.admin .admin-bar .company-controls{justify-content:center;flex-wrap:wrap;}}

.release-menu {position:relative;}
.release-menu summary {cursor:pointer;color:#0057b8;white-space:nowrap;}
.release-menu-panel {position:absolute;right:0;z-index:6;background:white;border:1px solid #dce2ea;box-shadow:0 8px 24px #23314b24;border-radius:.7rem;padding:.55rem;display:grid;gap:.35rem;min-width:12rem;}
.release-menu-panel form {margin:0;}
.release-testers {max-height:12rem;overflow:auto;}
.release-testers label {display:flex;align-items:center;gap:.3rem;overflow-wrap:anywhere;}
.release-testers input[type=checkbox] {width:auto;min-height:0;}
.designer-readonly [data-add-field],.designer-readonly #designer-properties {display:none;}

.workshop-type-filter {display:flex;align-items:center;gap:.6rem;min-width:0;flex:1;} .workshop-type-filter select {width:auto;min-width:0;flex:0 1 auto;} .workshop-type-filter #workshop-search {min-width:0;flex:0 1 15rem;}
#workshop-search {width:min(15rem,100%);}
.workshop-number {width:1%;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;}
.release-popup {width:min(30rem,calc(100vw - 2rem));}
.release-popup-heading {display:flex;justify-content:space-between;align-items:center;gap:1rem;}
.release-popup-heading h2 {margin:0;}
.release-popup-version {color:#526078;margin:.25rem 0 1rem;}
.release-popup-actions {display:flex;gap:.5rem;flex-wrap:wrap;align-items:flex-start;}
.release-popup-actions > details {width:100%;margin-top:.5rem;}

.designer-phone-heading {display:grid;grid-template-columns:minmax(0,1fr) 56px minmax(0,1fr);}
.designer-phone-arrows {justify-self:end;}
.designer-brand {height:26px;position:relative;}
.designer-brand img {display:block;width:56px;height:26px;object-fit:contain;}
.designer-brand input {position:absolute;inset:0;width:100%;height:100%;padding:0;opacity:0;cursor:pointer;}
.designer-brand:focus-within {outline:2px solid #0064d0;outline-offset:3px;border-radius:4px;}
.designer-brand [role=status]:not(:empty) {position:absolute;top:100%;left:50%;transform:translateX(-50%);width:max-content;max-width:170px;background:white;padding:.25rem;z-index:2;}

.designer-phone {background:#fff;}

.designer-preview-heading {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:.4rem;}
.designer-preview-heading > h2 {margin:0;grid-column:1;}
.designer-preview-heading > .release-trigger {grid-column:3;justify-self:end;}
.designer-release-status {grid-column:2;text-align:center;color:#526078;font-weight:600;}
.designer-release-status--published {color:#147646;}

.admin .board-links {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;align-items:start;gap:.5rem .35rem;}
.admin .board-links > p {grid-column:1/-1;margin:0;}
.admin .board-links > .board-link {background:transparent;color:inherit;border:1px solid transparent;font-weight:400;min-height:7rem;line-height:1.2;overflow-wrap:anywhere;}
.admin .board-links > button.board-link:hover {background:#f4f8ff;}
.admin .board-links > button[aria-pressed="true"] {border-color:#b7d0fa;background:#eef5ff;}
.admin .board-links > .board-add {align-content:center;font-size:1.8rem;color:#0057b8;}

.rest-section-title {font-size:1rem;color:#243954;margin:1rem 0 .3rem;}
.rest-request-details {display:grid;grid-template-columns:auto minmax(0,1fr);gap:.4rem .75rem;margin:.6rem 0;background:#f5f8fc;padding:.65rem;border-radius:.5rem;font-size:.85rem;}
.rest-request-details dt {font-weight:600;}
.rest-request-details dd {margin:0;overflow-wrap:anywhere;}

.field-type-icon {display:inline-block;vertical-align:middle;line-height:1;}
.preview-field-heading .field-type-icon {margin-inline-start:.35rem;}
.hidden-rest-fields .field-type-icon {margin-inline-end:.45rem;}
.field-type-icon--rest,.field-type-icon--hidden {inline-size:1.1em;block-size:1.1em;background:currentColor;mask:var(--field-icon) center/contain no-repeat;}
.field-type-icon--rest {--field-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cellipse cx='12' cy='12' rx='4' ry='9'/%3E%3Cpath d='M3 12h18'/%3E%3C/svg%3E");}
.field-type-icon--hidden {--field-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18M10 10a3 3 0 0 0 4 4M16 17c-5 2-10 0-14-5a18 18 0 0 1 4-4m4-2c5-1 9 1 12 6l-2 3'/%3E%3C/svg%3E");}

.admin .designer-phone .preview-field--hidden {min-height:44px;height:auto;border-style:dashed;background:#f8fafc;padding:.5rem .65rem;}
.admin .designer-phone .preview-field--hidden[aria-pressed=true] {border-style:solid;border-color:#0064d0;}

.designer-phone #designer-preview {grid-auto-rows:max-content;align-content:start;}
.admin .designer-phone button.preview-field {height:auto;min-height:44px;align-content:start;}
.admin .designer-phone button.preview-field > small,.preview-choice-card > small {display:block;line-height:1.35;white-space:normal;overflow-wrap:anywhere;}
.preview-choice-card {display:grid;gap:.4rem;border:1px solid var(--line);border-radius:.65rem;background:white;padding:.65rem;}
.admin .designer-phone .preview-choice-card > button.preview-field {padding:0;min-height:0;border:0;border-radius:0;outline:none;}
.preview-choice-card:has(button[aria-pressed=true]) {outline:2px solid var(--blue);outline-offset:-2px;}
.preview-choice-card > select {width:100%;min-width:0;}

.designer-page-picker {width:min(100%,24rem);margin:1rem auto 0;} .designer-page-picker select {width:100%;}

/* Mobile form in the designer and simulator */
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) {
  --form-separator: #e2e8ef;
  --form-control: #f1f5f9;
  --form-selection: #146b87;
  margin-top: .35rem;
  scrollbar-gutter: stable;
}
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > :is(.preview-field, .preview-choice-card) {
  display: grid;
  gap: .35rem;
  width: 100%;
  padding: .7rem .75rem;
  border: 0;
  border-bottom: 1px solid var(--form-separator);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: start;
}
.admin.company-workshop .designer-phone #designer-preview > :is(button.preview-field, .preview-choice-card) {
  border-inline-start: 1.5px solid transparent;
}
.admin.company-workshop .designer-phone #designer-preview > :is(button.preview-field[aria-pressed=true], .preview-choice-card:has(> button[aria-pressed=true]), .preview-action-group:has(> button[aria-pressed=true])) {
  outline: none;
  position: relative;
}
.admin.company-workshop .designer-phone #designer-preview > :is(button.preview-field[aria-pressed=true], .preview-choice-card:has(> button[aria-pressed=true]), .preview-action-group:has(> button[aria-pressed=true]))::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dotted #0866d5;
  border-radius: 8px;
  pointer-events: none;
  animation: designer-selection-pulse 2s ease-in-out infinite;
}
@keyframes designer-selection-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .admin.company-workshop .designer-phone #designer-preview > :is(button.preview-field[aria-pressed=true], .preview-choice-card:has(> button[aria-pressed=true]), .preview-action-group:has(> button[aria-pressed=true]))::after {
    animation: none;
  }
}
.admin.company-workshop .designer-phone #designer-preview button.preview-field:focus-visible {
  outline: 2px solid var(--form-selection);
  outline-offset: -2px;
}
.admin.company-workshop .designer-phone #designer-preview > .preview-field--hidden {
  background: #f7f9fb;
  color: #48576a;
}
.admin.company-workshop .designer-phone #designer-preview .preview-field-heading strong,
.admin.company-workshop .designer-phone #designer-simulation > .preview-field > label {
  font-weight: 650;
  color: #192737;
}
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) :is(.mock-input, .preview-field > input, .preview-field > select, .preview-choice-card > select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: .45rem .65rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: var(--form-control);
  color: #263647;
}
.admin.company-workshop .designer-phone #designer-simulation > .preview-field > input[readonly] {
  background: #eaf1f4;
  color: #354c5c;
}
.admin.company-workshop .designer-phone #designer-simulation .preview-field > small:empty {
  display: none;
}
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-action-buttons {
  margin-block-start: .8rem;
}

.designer-field-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.3rem;}
.admin .designer-field-actions > button {display:inline-flex;align-items:center;justify-content:center;gap:.3rem;min-width:0;padding:.5rem .2rem;white-space:nowrap;font-size:.85rem;}
.designer-field-actions svg {width:.85em;height:1em;fill:currentColor;flex:none;}
.admin .designer-field-actions > .designer-field-remove {color:#a42632;background:#fff0f1;}

.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  column-gap: .65rem;
}
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal > * { min-width: 0; }
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal > :is(input, select) { width: 100%; box-sizing: border-box; }
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal > small { grid-column: 1 / -1; }
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal .preview-field-heading { flex-wrap: wrap; overflow-wrap: anywhere; }
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) > .preview-field--horizontal > label { overflow-wrap: anywhere; }

.admin .admin-module-trigger { display: inline-flex; align-items: center; gap: .65rem; background: transparent; color: inherit; padding: .3rem; }
.admin .admin-module-trigger:hover { background: #edf4ff; }
.admin .admin-modules { width: min(36rem, calc(100% - 2rem)); box-sizing: border-box; max-height: min(75vh, 46rem); overflow: auto; border: 1px solid #dbe4ef; border-radius: 1rem; padding: 1.25rem; color: #16273a; background: white; box-shadow: 0 16px 48px #12263a30; }
.admin .admin-modules::backdrop { background: #15263d55; }
.admin .admin-module-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.admin .admin-module-heading h2 { margin: 0; }
.admin .admin-modules details { border-top: 1px solid #dbe4ef; padding: .75rem 0; }
.admin .admin-modules summary { font-weight: 650; cursor: pointer; }
.admin .admin-modules li { margin-bottom: .5rem; overflow-wrap: anywhere; }

/* Keep field metadata aligned across the design preview header. */
.admin.company-workshop .designer-phone #designer-preview > .preview-field--horizontal > :is(.preview-field-heading, button.preview-field) {
  grid-column: 1 / -1;
}
.admin.company-workshop .designer-phone #designer-preview > .preview-field--horizontal .preview-field-heading {
  flex-wrap: nowrap;
  align-items: start;
}
.admin.company-workshop .designer-phone #designer-preview > .preview-field--horizontal .preview-field-heading small {
  margin-inline-start: auto;
  max-inline-size: 45%;
}
.admin.company-workshop .designer-phone #designer-preview > .preview-field--horizontal > :is(.mock-input, select) {
  grid-column: 2;
}

.designer-phone [data-value-alignment="left"] { --value-alignment: left; }
.designer-phone [data-value-alignment="center"] { --value-alignment: center; }
.designer-phone [data-value-alignment="right"] { --value-alignment: right; }
.designer-phone [data-value-alignment="justify"] { --value-alignment: justify; }
.admin.company-workshop .designer-phone :is(#designer-preview, #designer-simulation) [data-value-alignment] {
  text-align: var(--value-alignment);
}
.designer-phone input[data-value-alignment]::-webkit-datetime-edit {
  text-align: var(--value-alignment);
}

.value-alignment-caption { display: block; }
.value-alignment-options { display: flex; gap: .35rem; margin-block: .35rem .7rem; }
.admin .value-alignment-option { display: grid; place-items: center; width: 2.5rem; min-height: 2.5rem; padding: .45rem; border: 2px solid transparent; }
.admin .value-alignment-option[aria-pressed="true"] { border-color: #005fca; background: #e8f1ff; }
.value-alignment-icon { display: flex; flex-direction: column; gap: 3px; width: 1.05rem; }
.value-alignment-icon[data-align="center"] { align-items: center; }
.value-alignment-icon[data-align="right"] { align-items: flex-end; }
.value-alignment-icon i { display: block; width: 100%; height: 2px; border-radius: 1px; background: currentColor; }
.value-alignment-icon:not([data-align="justify"]) i:nth-child(even) { width: 62%; }

.manual-choice-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; gap: .35rem; align-items: center; margin-block: .5rem; }
.manual-choice-row { display: contents; }
.manual-choice-row input { min-width: 0; width: 100%; box-sizing: border-box; }
.admin .manual-choice-row button { padding-inline: .6rem; }

.admin #company-admin-access { inset: 0; margin: auto; }
.admin-module-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap: .75rem; align-items: start; }
.admin .admin-module-grid details { border: 1px solid #dbe4ef; border-radius: .7rem; padding: 0; }
.admin-module-grid summary { display: grid; place-items: center; gap: .3rem; padding: .85rem; background: #edf4ff; border-radius: .65rem; color: #174681; }
.admin-module-grid summary span { font-size: 1.35rem; }
.admin-module-grid details > h3 { margin-inline: .8rem; }
.admin-module-grid ul { padding-inline: 1.5rem .6rem; }
.data-source-page { max-width: 65rem; margin: 2rem auto; }
.data-source-page details { border: 1px solid #dbe4ef; border-radius: .75rem; padding: 1rem; }
.data-source-page summary { cursor: pointer; font-weight: 650; }
.data-source-page form { display: grid; gap: .8rem; margin-block-start: 1rem; }
.data-source-page form button { justify-self: start; }
.data-source-page table { width: 100%; margin-block-start: 1rem; }
.data-source-page td { overflow-wrap: anywhere; }
.data-source-shortcut { display: grid; place-items: center; min-height: 4rem; }
.admin.company-workshop .data-source-detail { max-width: none; width: 100%; box-sizing: border-box; }
.data-source-scroll { overflow-x: auto; }
.admin .data-source-detail th select { display: block; min-width: 7rem; width: auto; margin-top: .4rem; }
.data-source-titlebar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.admin .data-source-titlebar h1 { margin: 0; font-size: 1.5rem; }
.data-source-title-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.admin .data-source-title-actions .data-source-back { background: #167343; color: #fff; }
.admin .data-source-title-actions .data-source-back:hover { background: #105c35; }
.data-source-index tbody td:first-child { font-weight: 650; }
.source-format { display: inline-block; padding: .25rem .65rem; border-radius: 999px; font-weight: 650; color: #174681; background: #edf4ff; }
.source-format[data-format="excel"] { color: #16613e; background: #e8f6ed; }
.admin .source-picker[popover] { inset: 0; margin: auto; }
.admin .source-picker-error { margin-top: 1rem; width: 100%; }
.source-type-picker { display: flex; gap: .6rem; border: 0; padding: 0; margin: 0 0 1rem; }
.source-type-picker legend { padding: 0; margin-bottom: .4rem; }
.admin .source-type-picker label { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; margin: 0; border: 1px solid #dbe4ef; border-radius: .65rem; cursor: pointer; }
.admin .source-type-picker label:has(:checked) { background: #edf4ff; border-color: #0866d5; }
.source-picker:has([value="json"]:checked) .source-form-excel, .source-picker:has([value="excel"]:checked) .source-form-json { display: none; }
.admin .source-icon { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: .6rem; background: #eaf2ff; color: #0758b3; vertical-align: middle; }
.admin .source-icon:hover { background: #dceaff; }
.source-icon svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin .source-endpoint { inset: 0; margin: auto; overflow-wrap: anywhere; }
.admin .source-delete { margin-inline-start: .25rem; background: #fff0f0; color: #a42632; }
.admin .source-delete:hover { background: #ffe0e0; }

.admin .data-source-index .source-endpoint form[action$="/delete"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.designer-name-error { display: block; color: #b4232a; }
.designer-name-error:empty { display: none; }
.designer-column-filters fieldset { min-width: 0; margin: .55rem 0; padding: .6rem; border: 1px solid #dbe4ef; border-radius: .6rem; }

.admin.company-workshop .designer-phone #designer-preview > .preview-action-group > .preview-field {
  width: 100%;
}
.admin.company-workshop .designer-phone #designer-preview > .preview-action-group > .preview-action-buttons {
  margin-block-start: .8rem;
}

.admin.company-workshop .designer-phone #designer-preview .preview-action-group > .preview-field[aria-pressed=true]:not(:focus-visible) {
  outline: none;
}
#designer-preview .preview-field-invalid { position: relative; }
.designer-error-rail .preview-field-error {
  position: absolute;
  inset-inline-start: 0;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c81e30;
  animation: designer-field-error-pulse 1.6s ease-in-out infinite;
}
@keyframes designer-field-error-pulse { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) {
  .designer-error-rail .preview-field-error { animation: none; }
}

.designer-error-rail {
  position: absolute;
  inset-block: 0;
  inset-inline-start: -15px;
  width: 7px;
  pointer-events: none;
}

#app-icon-dialog{width:min(460px,calc(100% - 32px));max-height:calc(100% - 32px);padding:0;border:1px solid #e2e8f0;border-radius:20px;background:#fff;color:#17263d;box-shadow:0 24px 80px #12244238;overflow:auto;box-sizing:border-box}
#app-icon-dialog::backdrop{background:#0f203866;backdrop-filter:blur(3px)}
#app-icon-dialog header,#app-icon-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px}
#app-icon-dialog header{border-bottom:1px solid #e7edf5}#app-icon-dialog footer{border-top:1px solid #e7edf5;justify-content:flex-end;flex-wrap:wrap;background:#f8fafd}
#app-icon-dialog h2{margin:0;font-size:21px}#app-icon-dialog header p,#app-icon-dialog .icon-preview span{margin:4px 0 0;color:#52647b;font-size:13px}
#app-icon-dialog .icon-content{padding:18px 22px}#app-icon-dialog .icon-picker{display:grid;gap:8px;padding:14px;border:1px dashed #a8bbd5;border-radius:12px;font-weight:600}
#app-icon-dialog input{width:100%;box-sizing:border-box;font-size:13px}#app-icon-dialog .icon-preview{display:grid;justify-items:center;gap:12px;padding:14px;margin-top:14px;background:#f4f7fb;border-radius:12px}
#app-icon-dialog canvas{width:128px;height:128px;border-radius:10px;background:#fff}#app-icon-dialog [role=status]{margin:10px 0 0;color:#a52135;font-size:14px}#app-icon-dialog [role=status]:empty{display:none}
#app-icon-dialog .icon-close,#app-icon-dialog [data-download]{background:#eaf1fa;color:#174476}#app-icon-dialog .icon-close{padding:5px 12px;font-size:20px}#app-icon-dialog button:disabled{opacity:.5}

.admin .company-regional-row > td { padding-top: .25rem; }
.company-regional-panel > summary { cursor: pointer; color: #0753a6; font-weight: 600; }
.company-regional-panel[open] > form { margin-top: .75rem; padding: 1rem; border: 1px solid #dce5ef; border-radius: .75rem; background: #f6f9fd; }
.admin .company-regional-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem 1rem; align-items: start; }
.company-regional-grid [data-zone-filter] { grid-column: span 1; }
.company-regional-grid [role="status"] { grid-column: 1 / -1; }
.company-regional-grid [role="status"]:empty { display: none; }
.company-regional-grid select, .company-regional-grid input { min-width: 0; width: 100%; }
.company-regional-actions { display: flex; justify-content: flex-end; margin-top: .75rem; }
@media (max-width: 1100px) { .admin .company-regional-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .admin .company-regional-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .admin .company-regional-grid, .company-regional-grid [data-zone-filter] { grid-template-columns: minmax(0, 1fr); } .company-regional-grid [data-zone-filter] { grid-column: auto; } }

.regional-picker { min-width: 0; }
.regional-picker-label { display: block; font-weight: 600; margin-bottom: .4rem; }
.regional-picker-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch; }
.admin .regional-picker-controls input, .admin .regional-picker-controls select { margin: 0; width: 100%; min-width: 0; }
.admin .regional-picker-controls input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.admin .regional-picker-controls select { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.regional-picker-controls :focus { position: relative; z-index: 1; }
.admin .company-regional-grid > .regional-picker { grid-column: span 2; }
@media (max-width: 480px) { .admin .company-regional-grid > .regional-picker { grid-column: auto; } }

.company-name-editor > summary { display: inline-flex; align-items: center; gap: .45rem; list-style: none; cursor: pointer; } .company-name-editor > summary::-webkit-details-marker { display: none; } .company-name-pencil { flex: none; color: #0753a6; } .company-name-editor > form { margin-top: .65rem; }

.admin .company-list-number { width: 1%; white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; } .admin .company-regional-row > td { border-bottom: 2px solid #25835e; }

.company-name-display { display: inline-flex; align-items: center; gap: .35rem; }
.admin button.company-name-trigger { display: inline-grid; place-items: center; padding: .3rem; min-height: 0; border: 0; background: transparent; color: #0753a6; }
.company-edit-dialog { width: min(32rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; padding: 1.5rem; border: 1px solid #dce5ef; border-radius: 1rem; color: inherit; }
.company-edit-dialog::backdrop { background: rgba(15, 23, 42, .52); }
.company-edit-dialog form { display: grid; gap: .85rem; }
.company-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.company-edit-actions { display: flex; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; }

.designer-phone.designer-phone--external-scroll { width:min(calc(100% - 20px),538.2px); aspect-ratio:538.2 / 844; }
.admin.company-workshop .designer-phone--external-scroll:not(:has(> #designer-simulation:not([hidden]))) { aspect-ratio:auto; height:auto; }
.admin.company-workshop .designer-phone--external-scroll:not(:has(> #designer-simulation:not([hidden]))) > #designer-preview { flex:none; height:auto; max-height:none; overflow:visible; }
.admin.company-workshop .designer-phone--external-scroll:not(:has(> #designer-simulation:not([hidden]))) > .designer-phone-scroll-rail { display:none; }
.admin.company-workshop .designer-phone--external-scroll :is(#designer-preview,#designer-simulation) { scrollbar-width:none; scrollbar-gutter:auto; }
.designer-phone--external-scroll :is(#designer-preview,#designer-simulation)::-webkit-scrollbar { display:none; }
.designer-phone-scroll-rail { position:absolute; inset-inline-start:calc(100% + 8px); width:12px; overflow: hidden scroll; }
.designer-phone-scroll-rail[hidden] { display:none; }
.designer-phone-scroll-rail::-webkit-scrollbar { width:9px; }
.designer-phone-scroll-rail::-webkit-scrollbar-thumb { background:#a5acb6; border-radius:8px; }
.admin.company-workshop .designer-phone #designer-preview > div > section.preview-table { box-sizing:border-box; width:100%; padding:0; margin:0; display:block; border:1px solid #c6d9ed; border-radius:10px; overflow:hidden; }
.designer-phone .preview-table:has(> .preview-table-header[aria-pressed=true], > .preview-table-header:focus-visible) { outline:2px solid #0064d0; outline-offset:-2px; }
.admin.company-workshop .designer-phone #designer-preview .preview-table > .preview-table-header { box-sizing:border-box; width:100%; margin:0; border:0; border-radius:0; background:#c5c9cf; outline:none; box-shadow:none; }

.admin.company-workshop .designer-phone #designer-preview .preview-action-group--selected { position:relative; border-radius:.65rem; outline:2px solid #0064d0; outline-offset:-2px; }
.admin.company-workshop .designer-phone #designer-preview .preview-action-group--selected > .preview-field { outline:none; box-shadow:none; }

.workshop-row-actions { display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
.workshop-row-actions form { margin:0; }

.workshop-row-actions > a, .workshop-row-actions form button {display:inline-grid;place-items:center;width:36px;height:36px;padding:0;color:#1958a8;box-sizing:border-box;}

.workshop-row-actions form button.workshop-remove {color:#bf1830;background:#fff0f1;}
.workshop-row-actions form button.workshop-remove:hover {background:#ffe1e5;}
.workshop-archive-link {display:inline-block;margin-bottom:.5rem;}

.admin #workshop-apps th button.workshop-sort {
  display:inline-grid;place-items:center;vertical-align:middle;width:1.4rem;height:1.5rem;
  margin:0 0 0 .1rem;padding:0;border:0;border-radius:.25rem;box-shadow:none;
  background:transparent;color:#4b5d76;font:700 1rem/1 system-ui,sans-serif;cursor:pointer;
}
.admin #workshop-apps th button.workshop-sort:hover {background:#eaf1fa;color:#174d91;}
.admin #workshop-apps th button.workshop-sort:focus-visible {outline:2px solid #1958a8;outline-offset:1px;}

.workshop-catalog .component-table-wrap {min-width:0;overflow:visible;}
.admin #workshop-apps .workshop-row-actions {flex-wrap:nowrap;align-items:center;gap:.4rem;}
.admin #workshop-apps .workshop-row-actions > * {flex:none;}
.workshop-catalog #workshop-apps {width:100%;min-width:0;}
.workshop-catalog #workshop-apps th,
.workshop-catalog #workshop-apps td {padding:.65rem .4rem;white-space:normal;overflow-wrap:anywhere;}
.workshop-catalog #workshop-apps td {font-size:.95rem;}
.workshop-catalog #workshop-apps .component-title {min-width:0;gap:.45rem;}
.workshop-catalog #workshop-apps .component-title > a {min-width:0;overflow-wrap:anywhere;}
.workshop-catalog #workshop-apps .workshop-row-actions {gap:.3rem;}
.workshop-catalog #workshop-apps .workshop-row-actions > a,
.workshop-catalog #workshop-apps .workshop-row-actions form button {width:32px;height:32px;min-height:32px;}
.workshop-catalog #workshop-apps .workshop-row-actions svg {width:19px;height:19px;}

/* The native select sits over the language icon and opens directly. */
.admin .company-controls .company-language-trigger {
  position:relative;display:grid;place-items:center;width:2.4rem;height:2.4rem;
  margin:0;padding:0;background:transparent;border:0;border-radius:.4rem;box-shadow:none;
}
.admin .company-language-trigger #company-language {
  position:absolute;inset:0;width:100%;height:100%;min-width:0;margin:0;padding:0;
  opacity:0;cursor:pointer;z-index:1;
}
.admin .company-language-trigger:focus-within {outline:2px solid #2362a6;outline-offset:2px;}
.admin .company-language-trigger .company-language-icon {display:grid;place-items:center;margin:0;pointer-events:none;}

/* Superadmin module catalog */
.admin #admin-modules {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(68rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(86dvh, 54rem);
  padding: 0;
  border: 1px solid #dbe4ef;
  border-radius: 1.25rem;
  background: #f5f8fc;
  box-shadow: 0 24px 75px rgb(21 38 61 / 24%);
  overscroll-behavior: contain;
}
.admin #admin-modules::backdrop { background: rgb(21 38 61 / 48%); }
.admin #admin-modules .admin-module-heading {
  position: sticky;
  z-index: 1;
  top: 0;
  margin: 0;
  padding: 1rem clamp(1rem, 3vw, 1.75rem);
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid #dbe4ef;
}
.admin #admin-modules .admin-module-heading h2 { margin: 0; font-size: clamp(1.05rem, 2.2vw, 1.4rem); }
.admin #admin-modules > details {
  margin: 1rem clamp(.75rem, 3vw, 1.75rem);
  padding: 0;
  border: 1px solid #dbe4ef;
  border-radius: .875rem;
  background: #fff;
}
.admin #admin-modules > details > summary { padding: .9rem 1rem; color: #174e90; }
.admin #admin-modules > details[open] > summary { border-bottom: 1px solid #e4ebf4; }
.admin #admin-modules h3 { margin: 1.15rem 1rem .55rem; font-size: .95rem; color: #344b64; }
.admin #admin-modules ul { margin: .65rem 1rem 1rem; }
.admin #admin-modules h3 + ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: .65rem;
  padding: 0;
  list-style: none;
}
.admin #admin-modules h3 + ul > li {
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid #e4ebf4;
  border-radius: .65rem;
  background: #f8fafd;
}
.admin #admin-modules h3 + ul code { display: block; margin-top: .25rem; color: #395570; font-size: .82rem; }
.admin #admin-modules h3 + ul br { display: none; }
@media (max-width: 36rem) {
  .admin #admin-modules { width: calc(100vw - 1rem); max-height: 94dvh; }
}

.formula-brand{display:flex;align-items:center;gap:.65rem}.formula-back{display:inline-flex;align-items:center;padding:.75rem 1rem;border-radius:.65rem;background:#e8f1ff;color:#06478c;font-weight:700;text-decoration:none}.formula-back:hover{background:#d5e7ff}.formula-catalog{display:grid;gap:.85rem}.formula-catalog details{min-width:0;border:1px solid #d7e2ee;border-radius:.8rem;background:white;overflow:hidden}.formula-catalog summary{cursor:pointer;padding:1rem;font-weight:700;color:#184574}.formula-catalog ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:.65rem;padding:0 1rem 1rem;margin:0;list-style:none}.formula-catalog li{min-width:0;padding:.7rem .8rem;background:#f4f7fb;border:1px solid #e1e8f2;border-radius:.6rem;overflow-wrap:anywhere}.formula-catalog code{white-space:pre-wrap}.formula-catalog small{color:#53647a}.formula-page .admin-bar{gap:.75rem;flex-wrap:wrap}
.admin-modules .admin-module-formulas{display:block;padding:1rem;margin-bottom:1rem;border:1px solid #d7e2ee;border-radius:.8rem;background:white;font-weight:700;text-decoration:none}

.admin .superadmin-toolbar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:1rem;background:#fff;border-radius:.8rem;padding:1rem 1.1rem;margin-bottom:1rem}.superadmin-identity,.superadmin-actions{display:flex;align-items:center;gap:.65rem}.superadmin-identity{text-align:center}.superadmin-identity div span{display:block;color:#006bcc}.superadmin-avatar{display:grid;place-items:center;width:2.8rem;height:2.8rem;border-radius:50%;background:#e8effa;color:#345680}.superadmin-actions{justify-self:end}.superadmin-actions form{margin:0}.superadmin-actions .superadmin-icon{display:grid;place-items:center;width:2.5rem;height:2.5rem;padding:0;color:#263648;background:transparent;text-decoration:none}.superadmin-actions .superadmin-exit{color:#cf1236}.superadmin-actions .superadmin-icon:hover{background:#e8effa;border-radius:.5rem}@media(max-width:680px){.admin .superadmin-toolbar{grid-template-columns:1fr auto}.superadmin-identity{grid-row:2;grid-column:1/-1;justify-content:center}.superadmin-actions{gap:.3rem}}

.superadmin-company-tabs{position:relative}.superadmin-company-tabs>input{position:absolute;width:1px;height:1px;opacity:0}.superadmin-company-tab-labels{display:flex;gap:.45rem;margin-bottom:.75rem}.superadmin-company-tab-labels label{display:inline-flex;align-items:center;margin:0;padding:.7rem 1rem;border-radius:.65rem;background:#fff;border:1px solid #d7e2ee;color:#164b80;font-weight:700;cursor:pointer}.superadmin-company-tab-labels label:hover{background:#edf4ff}.superadmin-company-tabs #admin-tab-companies:checked~.superadmin-company-tab-labels label[for="admin-tab-companies"],.superadmin-company-tabs #admin-tab-new-company:checked~.superadmin-company-tab-labels label[for="admin-tab-new-company"]{background:#075ec5;color:#fff;border-color:#075ec5}.superadmin-company-tabs #admin-tab-companies:focus-visible~.superadmin-company-tab-labels label[for="admin-tab-companies"],.superadmin-company-tabs #admin-tab-new-company:focus-visible~.superadmin-company-tab-labels label[for="admin-tab-new-company"]{outline:2px solid #063c80;outline-offset:2px}.superadmin-company-tabs #admin-tab-companies:checked~.admin-company-create,.superadmin-company-tabs #admin-tab-new-company:checked~.admin-company-list{display:none}

/* Superadmin company tabs */
.superadmin-company-tab-labels {
  gap: 6px;
  padding: 0 14px 0 7px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.superadmin-company-tab-labels label {
  position: relative;
  isolation: isolate;
  justify-content: center;
  min-inline-size: 0;
  padding: .72rem clamp(.85rem, 2.5vw, 1.8rem);
  border: 0;
  border-radius: 0;
  background: none;
  color: #364152;
  text-align: center;
}
.superadmin-company-tab-labels label::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -6px 0 0;
  transform: skewX(11deg);
  border: 1px solid #d8dae2;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(#fafbfc, #e1e4e9);
}
.superadmin-company-tab-labels label:hover { background: none; color: #164b80; }
.superadmin-company-tabs #admin-tab-companies:checked ~ .superadmin-company-tab-labels label[for="admin-tab-companies"],
.superadmin-company-tabs #admin-tab-new-company:checked ~ .superadmin-company-tab-labels label[for="admin-tab-new-company"] {
  background: none;
  color: #164b80;
}
.superadmin-company-tabs #admin-tab-companies:checked ~ .superadmin-company-tab-labels label[for="admin-tab-companies"]::before,
.superadmin-company-tabs #admin-tab-new-company:checked ~ .superadmin-company-tab-labels label[for="admin-tab-new-company"]::before {
  background: #fff;
  border-bottom-color: #fff;
}
.superadmin-company-tabs > .admin-company-list,
.superadmin-company-tabs > .admin-company-create {
  margin-top: 0;
  border-top-left-radius: 0;
}

.superadmin-company-tabs > .admin-access-security {
  display: none;
  margin-top: 0;
  border-top-left-radius: 0;
}
.superadmin-company-tabs #admin-tab-access-security:checked ~ .admin-access-security { display: block; }
.superadmin-company-tabs #admin-tab-access-security:checked ~ :is(.admin-company-list, .admin-company-create) { display: none; }
.superadmin-company-tabs #admin-tab-access-security:checked ~ .superadmin-company-tab-labels label[for="admin-tab-access-security"] {
  background: none;
  color: #164b80;
}
.superadmin-company-tabs #admin-tab-access-security:checked ~ .superadmin-company-tab-labels label[for="admin-tab-access-security"]::before {
  background: #fff;
  border-bottom-color: #fff;
}
.superadmin-company-tabs #admin-tab-access-security:focus-visible ~ .superadmin-company-tab-labels label[for="admin-tab-access-security"] {
  outline: 2px solid #063c80;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .superadmin-company-tab-labels label { padding-inline: .5rem; font-size: .85rem; }
}

/* Formula controls in the form designer */
div:has(> button[data-formula-editor="filterFormula"]) > textarea {
  margin-block-start: 1rem;
}
button.secondary[data-formula-editor]:not([data-formula-editor="numericReadOnlyWhen"]) {
  border: 1px solid #3478c9;
}

/* Row filter formula layout */
div:has(> label > select):has(> div > button[data-formula-editor="filterFormula"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: .75rem;
}
div:has(> button[data-formula-editor="filterFormula"]) { display: contents; }
div:has(> button[data-formula-editor="filterFormula"]) > textarea { grid-column: 1 / -1; }
button.secondary[data-formula-editor="filterFormula"] {
  grid-column: 2;
  font-size: 1.4rem;
  grid-row: 1;
  align-self: end;
  width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
}
button[data-formula-editor="filterFormula"] > span { inset-inline-end: .3rem !important; top: .45rem !important; }

/* Independent scroll for the form designer's editing preview */
@media (min-width: 851px) {
  .designer-phone-viewport:not(:has(#designer-simulation:not([hidden]))) {
    max-block-size: max(52.25rem, calc(100dvh - 1.5rem));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable both-edges;
    padding-block: 2px .65rem;
  }
}

.designer-phone-scroll-buttons { display: none; }
@media (min-width: 851px) {
  .designer-phone-scroll-frame { position: relative; }
  .designer-phone-scroll-frame > .designer-phone-viewport:not(:has(#designer-simulation:not([hidden]))) {
    scrollbar-width: none;
    scrollbar-gutter: auto;
    margin-inline-end: 2.5rem;
  }
  .designer-phone-scroll-frame > .designer-phone-viewport:not(:has(#designer-simulation:not([hidden]))) + .designer-phone-scroll-buttons {
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: 50%;
    transform: translateY(-50%);
    display: grid;
    gap: 2px;
  }
  .designer-phone-scroll-buttons button.secondary {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: transparent;
    color: #175497;
    font-size: 1.25rem;
    line-height: 1;
  }
  .designer-phone-scroll-buttons button.secondary {
    border: 0;
    box-shadow: none;
  }
  .designer-phone-scroll-buttons button.secondary span {
    font-size: 0;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }
  .designer-phone-scroll-buttons button.secondary:first-child span { transform: rotate(225deg); }
  .designer-phone-scroll-buttons button.secondary:hover { background: transparent; color: #003d7c; }
}

/* Insertion guide in the form preview */
.designer-insertion-line,
.preview-field[data-insert-edge]::after {
  position: absolute;
  inset-inline: 4px;
  height: 3px;
  border-radius: 3px;
  background: #168251;
  pointer-events: none;
  z-index: 3;
}
.designer-insertion-line::before,
.preview-field[data-insert-edge]::before {
  content: '';
  position: absolute;
  inset-inline-start: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #168251;
  pointer-events: none;
  z-index: 4;
}
.designer-insertion-line::before { inset-inline-start: 0; top: 50%; transform: translateY(-50%); }
.preview-field[data-insert-edge] { position: relative; }
.preview-field[data-insert-edge]::after { content: ''; }
.preview-field[data-insert-edge="before"]::after { top: -3px; }
.preview-field[data-insert-edge="before"]::before { top: -5.5px; }
.preview-field[data-insert-edge="after"]::after { bottom: -3px; }
.preview-field[data-insert-edge="after"]::before { bottom: -5.5px; }

.company-language-trigger { position: relative; }
.company-language-trigger select[hidden], .company-language-options[hidden] { display: none; }
.company-language-trigger .company-language-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; border-radius: .65rem; cursor: pointer;
}
.company-language-trigger .company-language-toggle:hover,
.company-language-trigger .company-language-toggle[aria-expanded="true"] { background: #eaf2fc; }
.admin .company-language-trigger .company-language-options:not([hidden]) {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  position: absolute; inset-inline-end: calc(100% + 8px); inset-block-start: 0;
  z-index: 30; inline-size: 10rem; padding: .25rem; border: 1px solid #d6e1ef;
  background: #fff; border-radius: .55rem; box-shadow: 0 6px 18px #18375826;
}
.admin .company-language-trigger .company-language-options-below:not([hidden]) {
  inset-inline: 0 auto; inset-block-start: calc(100% + 8px);
}
.admin .company-language-trigger .company-language-options button {
  display: block; width: 100%; min-height: 0; border: 0; color: #243447;
  background: transparent; margin: 0; padding: .35rem .55rem; border-radius: .3rem;
  font-size: .875rem; font-weight: 400; line-height: 1.25; text-align: start; cursor: pointer;
}
.admin .company-language-trigger .company-language-options button:hover { background: #f2f5f9; }
.company-language-options { max-block-size: min(16rem, 50vh); overflow-y: auto; overscroll-behavior-y: contain; }


.data-source-index .source-formula-id { overflow-wrap: anywhere; }
.data-source-index .source-settings-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; }

.data-source-index .source-linked-count { padding: .3rem .65rem; min-width: 2rem; }
.source-linked-app-list { max-height: 50vh; overflow-y: auto; margin: 1rem 0; padding-inline-start: 1.3rem; }
.source-linked-app-list > li + li { margin-top: .8rem; }
.source-linked-form { margin-top: .35rem; }
.source-linked-form ul { margin: .2rem 0; padding-inline-start: 1.3rem; }
