.app-body{
  min-height:100vh;
  overflow:hidden;
  color:#17212b;
  background:
    linear-gradient(180deg, rgba(235,240,244,0.92), rgba(207,216,224,0.94)),
    linear-gradient(90deg, rgba(30,43,56,0.05) 1px, transparent 1px),
    linear-gradient(rgba(30,43,56,0.045) 1px, transparent 1px);
  background-size:cover, 32px 32px, 32px 32px;
}

.app-shell-page{
  width:min(1560px, calc(100vw - 16px));
  height:calc(100vh - 8px);
  margin:4px auto;
  padding:5px;
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow:hidden;
  border:1px solid #9da8b2;
  border-radius:6px;
  background:#dce4eb;
  box-shadow:0 22px 54px rgba(17, 24, 39, 0.18);
  backdrop-filter:none;
}

.app-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:36px;
  padding:3px 5px;
  border:1px solid #b4bec7;
  border-radius:4px;
  background:linear-gradient(180deg, #f3f6f8 0%, #d7e0e8 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.76);
}

.app-topbar-main{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.app-topbar .site-brand{
  gap:8px;
  min-width:205px;
}

.app-topbar .brand-mark{
  width:30px;
  height:30px;
  border-radius:5px;
  padding:2px;
  background:rgba(8,14,22,0.78);
  box-shadow:none;
}

.app-topbar .site-brand-copy strong{
  font-size:0.86rem;
  letter-spacing:0.01em;
}

.app-topbar .site-brand-copy span{
  font-size:0.61rem;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:#5e6974;
}

.app-topbar-nav{
  display:flex;
  align-items:center;
  gap:0;
  overflow:hidden;
  border:1px solid #aeb8c2;
  border-radius:4px;
  background:#edf1f4;
}

.app-topbar-nav a{
  min-height:28px;
  padding:7px 11px;
  border-right:1px solid #c3cbd3;
  border-radius:0;
  color:#52606d;
  font-weight:700;
  font-size:0.7rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  text-decoration:none;
}

.app-topbar-nav .nav-soon summary{
  min-height:28px;
  padding:7px 11px;
  border-right:1px solid #c3cbd3;
  border-radius:0;
  color:#52606d;
  font-weight:700;
  font-size:0.7rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.app-topbar-nav .nav-soon[open] summary,
.app-topbar-nav .nav-soon summary:hover{
  background:#dbe3ea;
  color:#172535;
}

.app-topbar-nav .nav-soon-popover{
  top:calc(100% + 8px);
  right:auto;
  left:0;
  width:220px;
  text-transform:none;
  letter-spacing:0;
}

.app-topbar-nav a:last-child{
  border-right:none;
}

.app-topbar-nav a.is-current{
  background:#172535;
  color:#f4f7fa;
}

.app-topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  min-width:0;
}

.app-topbar-actions .ghost-button,
.app-topbar-actions .primary-button{
  min-height:28px;
  padding:5px 9px;
  border-radius:4px;
  font-size:0.74rem;
  letter-spacing:0.05em;
  text-transform:uppercase;
}

.app-topbar-actions .account-pill{
  display:flex;
  flex-direction:column;
  justify-content:center;
  cursor:pointer;
  list-style:none;
  min-height:28px;
  min-width:138px;
  padding:5px 8px;
  border-radius:4px;
  background:#f3f6f8;
  border:1px solid #b7c0c9;
}

.app-topbar-actions .account-pill::-webkit-details-marker{
  display:none;
}

.account-menu{
  position:relative;
  z-index:30;
}

.account-panel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:min(360px, calc(100vw - 24px));
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid #344453;
  border-radius:8px;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    #121d27;
  background-size:18px 18px, 18px 18px, cover;
  box-shadow:0 22px 62px rgba(0, 0, 0, 0.34);
}

.account-panel::before{
  content:"";
  position:absolute;
  top:-6px;
  right:24px;
  width:10px;
  height:10px;
  border-left:1px solid #344453;
  border-top:1px solid #344453;
  background:#121d27;
  transform:rotate(45deg);
}

.account-auth-fields{
  display:grid;
  gap:8px;
}

.account-panel.is-authenticated .account-auth-fields{
  display:none;
}

.account-plan-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 10px;
  border:1px solid #344453;
  border-radius:4px;
  background:#15212c;
}

.account-plan-row span{
  flex:0 0 auto;
  color:#91a3b2;
  font-size:0.62rem;
  font-weight:800;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.account-plan-row strong{
  min-width:0;
  color:#d5b06a;
  font-size:0.78rem;
  text-align:right;
  overflow-wrap:anywhere;
}

.account-pill-label{
  font-size:0.62rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.app-project-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:32px;
  padding:3px 7px;
  border:1px solid #aeb8c2;
  border-radius:4px;
  background:linear-gradient(180deg, #e9eff4, #d2dde6);
}

.app-project-copy{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.app-project-copy .panel-kicker{
  color:#4f5c68;
  white-space:nowrap;
}

.app-work-meta{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.app-work-meta strong{
  font-family:"IBM Plex Sans", "Segoe UI", sans-serif;
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:#152230;
  white-space:nowrap;
}

.app-work-meta span{
  color:#5d6a75;
  font-size:0.66rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
  white-space:nowrap;
}

.app-project-fields{
  display:flex;
  align-items:end;
  gap:6px;
  min-width:0;
}

.app-project-fields .field{
  min-width:140px;
  flex:0 1 190px;
  gap:2px;
}

.app-project-fields .field input{
  min-height:26px;
  padding:0 8px;
  border-radius:3px;
  border-color:#aeb8c2;
  background:#f8fafb;
  font-size:0.78rem;
}

.app-project-fields .field span{
  font-size:0.62rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.app-workspace{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(360px, 0.42fr) minmax(720px, 1fr);
  gap:4px;
  align-items:stretch;
}

.app-editor-column,
.app-preview-column{
  min-width:0;
  min-height:0;
}

.editor-shell,
.preview-shell{
  height:100%;
  min-height:0;
  border:1px solid #9faab4;
  border-radius:4px;
  background:
    linear-gradient(rgba(20,34,48,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,34,48,0.03) 1px, transparent 1px),
    #d3dce4;
  background-size:18px 18px, 18px 18px, cover;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.55);
}

.editor-shell{
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:4px;
  overflow:auto;
}

.editor-toolbar-shell{
  flex:0 0 auto;
  position:relative;
  z-index:30;
}

.editor-tabs{
  position:relative;
  z-index:31;
  display:flex;
  flex-wrap:nowrap;
  gap:0;
  overflow:auto hidden;
  border:1px solid #a9b4be;
  border-radius:3px;
  background:#e4ebf1;
}

.editor-tab{
  flex:1 0 auto;
  min-height:26px;
  padding:6px 8px;
  border:none;
  border-right:1px solid #c1cad2;
  border-radius:0;
  background:transparent;
  color:#596673;
  font-weight:700;
  font-size:0.65rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.editor-tab:last-child{
  border-right:none;
}

.editor-tab.is-active{
  background:#172535;
  color:#eff4f7;
}

.editor-panel,
.utility-disclosure,
.preview-panel{
  border:1px solid #9faab4;
  border-radius:4px;
  background:#e8eef3;
  box-shadow:none;
}

.editor-panel{
  padding:6px;
}

.editor-panel-soft{
  background:#dde6ee;
}

.editor-meta-bar{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  min-height:30px;
  padding:4px 6px;
  background:#dce5ec;
}

.view-panel{
  position:relative;
  z-index:1;
  min-height:0;
  overflow:auto;
}

.view-panel.is-active{
  flex:1 1 auto;
}

.editor-compact-header,
.editor-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:5px;
  padding-bottom:5px;
  border-bottom:1px solid #c8d0d7;
}

.editor-section-head .card-kicker,
.preview-panel .card-kicker{
  font-size:0.6rem;
  letter-spacing:0.14em;
  color:#60707d;
}

.editor-section-head h3,
.preview-panel h3{
  font-family:"IBM Plex Sans", "Segoe UI", sans-serif;
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:#1a2836;
}

.view-panel[data-view="pattern"].is-active .editor-panel{
  min-height:100%;
  background:
    linear-gradient(rgba(20,34,48,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,34,48,0.03) 1px, transparent 1px),
    #e8eef3;
  background-size:18px 18px, 18px 18px, cover;
}

.view-panel[data-view="pattern"] .tool-row{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  align-items:start;
}

.view-panel[data-view="pattern"] .field{
  min-width:0;
}

.technical-control-row{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr)) auto;
  align-items:end;
  gap:5px;
}

.parameter-list-inline{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:4px 8px;
}

.parameter-list-inline div{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  padding:0;
  border-bottom:none;
}

.parameter-list-inline span,
.parameter-list span{
  color:#60707d;
  font-size:0.63rem;
}

.parameter-list-inline strong,
.parameter-list strong{
  color:#1b2936;
  font-size:0.74rem;
}

.parameter-list-inline-soft{
  margin-top:8px;
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.parameter-list-compact{
  gap:0;
}

.parameter-list-compact div{
  padding:5px 0;
  border-bottom:1px solid #c8d0d7;
}

.tool-row,
.tool-row-tight,
.tool-row-compact{
  gap:5px;
  margin-bottom:6px;
}

.tool-row-compact .field,
.field{
  min-width:130px;
  flex:1 1 145px;
  gap:4px;
}

.field.field-wide{
  flex-basis:260px;
}

.field span,
.tool-row-compact .field span,
.editor-panel .field span{
  color:#5f6e7a;
  font-size:0.59rem;
  font-weight:700;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.field input,
.field select,
.tool-row-compact .field input,
.tool-row-compact .field select,
.editor-panel .field input,
.editor-panel .field select{
  min-height:30px;
  padding:0 7px;
  border:1px solid #aeb8c2;
  border-radius:3px;
  background:#f8fafb;
  color:#17212b;
  font-size:0.78rem;
}

.field-inline-value{
  display:block;
  margin-top:2px;
  color:#66727d;
  font-size:0.68rem;
  font-weight:600;
}

.ghost-button,
.primary-button,
.tool-row-compact .ghost-button,
.tool-row-compact .primary-button,
.preview-panel .ghost-button{
  min-height:26px;
  padding:4px 8px;
  border-radius:3px;
  border:1px solid #a8b3bd;
  font-size:0.66rem;
  font-weight:700;
  letter-spacing:0.07em;
  text-transform:uppercase;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.55);
  transform:none;
}

.ghost-button{
  background:linear-gradient(180deg, #fbfcfd, #dfe6ec);
  color:#243240;
}

.primary-button{
  background:linear-gradient(180deg, #26384a, #152535);
  color:#f6f9fb;
  border-color:#112131;
}

.ghost-button:hover,
.primary-button:hover{
  transform:none;
  filter:brightness(0.98);
}

.guide-pill,
.draft-guides-compact .guide-pill{
  padding:5px 8px;
  border-radius:3px;
  border:1px solid #aeb8c2;
  background:#f6f8fa;
  color:#5f6e7a;
  font-size:0.68rem;
}

.draft-preview-tight{
  grid-template-columns:1fr;
  gap:8px;
}

.draft-canvas{
  max-width:360px;
  border-radius:3px;
  border-color:#9faab4;
  background:#f7f9fa;
}

.draft-guides-compact{
  gap:6px;
}

.threading-summary-panel{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:6px;
  margin-top:2px;
}

.threading-summary-panel div{
  min-width:0;
  padding:7px 8px;
  border-radius:3px;
  border:1px solid #344453;
  background:#f7f9fa;
  color:#14202a;
}

.threading-summary-panel span{
  display:block;
  color:#6a747d;
  font-size:0.62rem;
  letter-spacing:0.06em;
  text-transform:uppercase;
}

.threading-summary-panel strong{
  display:block;
  margin-top:3px;
  font-size:0.78rem;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.palette-grid{
  gap:8px;
}

.color-picker-open{
  border-color:rgba(255,255,255,0.22);
  border-radius:8px;
  background:rgba(5,10,16,0.34);
  color:inherit;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.08);
}

.color-picker-open span{
  font-size:0.62rem;
  font-weight:800;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.color-picker-open strong{
  font-size:0.76rem;
}

.color-picker-panel{
  --picker-hue:#ff0000;
  display:grid;
  gap:10px;
  margin-top:2px;
  padding:12px;
  border:1px solid rgba(213,176,106,0.28);
  border-radius:10px;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    rgba(6,12,18,0.82);
  background-size:16px 16px, 16px 16px, cover;
  box-shadow:0 18px 38px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.06);
  color:#edf5fb;
}

.color-picker-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.color-picker-head span,
.color-picker-hex span{
  color:#d5b06a;
  font-size:0.62rem;
  font-weight:800;
  letter-spacing:0.11em;
  text-transform:uppercase;
}

.color-picker-close{
  min-height:28px;
  padding:5px 9px;
  border:1px solid rgba(132,151,167,0.32);
  border-radius:6px;
  background:rgba(24,36,48,0.86);
  color:#edf5fb;
  font-size:0.66rem;
  font-weight:800;
}

.color-picker-field,
.color-picker-hue{
  position:relative;
  width:100%;
  touch-action:none;
  user-select:none;
  cursor:crosshair;
}

.color-picker-field{
  height:172px;
  border:1px solid rgba(255,255,255,0.18);
  border-radius:9px;
  background:
    linear-gradient(0deg, #000, transparent),
    linear-gradient(90deg, #fff, rgba(255,255,255,0)),
    var(--picker-hue);
  overflow:hidden;
}

.color-picker-field-handle,
.color-picker-hue-handle{
  position:absolute;
  pointer-events:none;
  transform:translate(-50%, -50%);
  border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,0.55), 0 6px 14px rgba(0,0,0,0.32);
}

.color-picker-field-handle{
  width:18px;
  height:18px;
  border-radius:999px;
}

.color-picker-hue{
  height:24px;
  border:1px solid rgba(255,255,255,0.18);
  border-radius:999px;
  background:linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.color-picker-hue-handle{
  top:50%;
  width:12px;
  height:30px;
  border-radius:999px;
  background:rgba(12,18,26,0.5);
}

.color-picker-hex{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) 34px;
  align-items:center;
  gap:8px;
}

.color-picker-hex input{
  width:100%;
  min-height:34px;
  padding:0 10px;
  border:1px solid rgba(91,113,132,0.72);
  border-radius:6px;
  background:#0b141e;
  color:#edf5fb;
  font-size:0.82rem;
  font-weight:700;
  text-transform:uppercase;
}

.color-picker-hex i{
  display:block;
  width:34px;
  height:34px;
  border:1px solid rgba(255,255,255,0.24);
  border-radius:7px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.12);
}

.utility-disclosure{
  flex:0 0 auto;
  margin-top:0;
  overflow:hidden;
  background:#dce5ec;
}

.utility-disclosure summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 9px;
  cursor:pointer;
  font-weight:700;
  list-style:none;
  font-size:0.68rem;
  letter-spacing:0.09em;
  text-transform:uppercase;
}

.utility-disclosure summary::-webkit-details-marker{
  display:none;
}

.utility-disclosure[open]{
  overflow:auto;
}

.utility-disclosure[open] summary{
  border-bottom:1px solid #c8d0d7;
}

.utility-disclosure-content{
  padding:8px 10px 10px;
}

.utility-grid{
  display:grid;
  grid-template-columns:minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap:10px;
}

.utility-grid-single{
  grid-template-columns:1fr;
}

.auth-panel{
  gap:8px;
}

.auth-summary,
.auth-status,
.local-projects-status{
  padding:9px 10px;
  border-radius:3px;
  border:1px solid #aeb8c2;
  background:#f6f8fa;
}

.preview-shell{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:5px;
  overflow:hidden;
}

.preview-panel{
  padding:5px;
}

.preview-panel-hero{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:#e4ebf1;
}

.preview-panel-secondary{
  flex:0 0 auto;
  background:#dce5ec;
}

.preview-panel-secondary .parameter-list-compact{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:0;
}

.preview-panel-secondary .parameter-list-compact div{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
  padding:3px 7px;
  border-bottom:none;
  border-right:1px solid #c8d0d7;
}

.preview-panel-secondary .parameter-list-compact div:last-child{
  border-right:none;
}

.preview-panel-secondary .parameter-list-compact strong{
  overflow-wrap:anywhere;
  white-space:normal;
}

.preview-panel .card-header{
  flex:0 0 auto;
  align-items:center;
  margin-bottom:3px;
  padding-bottom:3px;
  border-bottom:1px solid #c8d0d7;
}

.preview-panel-hero > .card-header{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:6px;
}

.preview-panel-hero > .card-header::before{
  content:"Viewport  /  Live Fabric  /  200 x 200";
  align-self:center;
  justify-self:start;
  grid-column:2;
  grid-row:1;
  padding:3px 7px;
  border:1px solid #aeb8c2;
  border-radius:3px;
  background:#f6f8fa;
  color:#5f6c78;
  font-size:0.58rem;
  font-weight:700;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.preview-meta-strip{
  display:none;
}

.preview-meta-strip span{
  padding:5px 8px;
  border-right:1px solid #c8d0d7;
  font-size:0.62rem;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:#5f6c78;
  font-weight:700;
}

.preview-meta-strip span:last-child{
  border-right:none;
}

.app-preview-stage{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  border:1px solid #8896a3;
  border-radius:3px;
  background:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(180deg, #bfc9d2 0%, #aab7c2 100%);
  background-size:24px 24px, 24px 24px, cover;
  overflow:hidden;
}

.app-preview-stage .fabric-preview-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

.measurement-overlay-canvas{
  position:absolute;
  inset:0;
  z-index:2;
  width:100%;
  height:100%;
  pointer-events:none;
}

.app-preview-stage.is-measuring .measurement-overlay-canvas{
  cursor:crosshair;
  pointer-events:auto;
  touch-action:none;
}

.app-preview-stage .fabric-overlay{
  position:absolute;
  z-index:3;
  inset:6px auto auto 6px;
  min-height:0;
  width:auto;
  max-width:min(390px, calc(100% - 12px));
  padding:5px 7px;
  pointer-events:none;
  border:1px solid rgba(218,226,234,0.28);
  border-radius:3px;
  background:rgba(12, 22, 32, 0.76);
  box-shadow:0 8px 18px rgba(7, 12, 18, 0.18);
}

.measurement-info-panel{
  position:absolute;
  left:42px;
  bottom:44px;
  z-index:3;
  max-width:min(430px, calc(100% - 188px));
  padding:5px 7px;
  pointer-events:none;
  border:1px solid rgba(218,226,234,0.28);
  border-radius:3px;
  background:rgba(12, 22, 32, 0.76);
  box-shadow:0 8px 18px rgba(7, 12, 18, 0.18);
}

.measurement-info-panel span{
  display:block;
  color:rgba(247,250,252,0.62);
  font-size:0.56rem;
  font-weight:800;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.measurement-info-panel strong{
  display:block;
  margin-top:2px;
  color:#fff7e8;
  font-size:0.72rem;
  font-weight:800;
  line-height:1.22;
}

.measurement-info-panel p{
  margin-top:2px;
  color:rgba(247,250,252,0.62);
  font-size:0.55rem;
  line-height:1.25;
}

.fabric-overlay strong{
  color:#f7fafc;
  font-size:0.68rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.fabric-overlay p{
  max-width:320px;
  margin-top:2px;
  color:rgba(247,250,252,0.78);
  font-size:0.6rem;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.preview-action-row{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:2px;
  margin-top:3px;
  margin-bottom:0;
}

.preview-action-row .ghost-button{
  width:100%;
}

.app-report-panel .report-sheet{
  width:100%;
  min-height:auto;
}

.app-report-panel .report-preview-wrap{
  padding-top:0;
}

.report-canvas-shell{
  width:min(100%, 760px);
  border-radius:3px;
  border:1px solid #9faab4;
  background:#ffffff;
  box-shadow:0 14px 30px rgba(17, 24, 39, 0.08);
  overflow:hidden;
}

#reportA4Canvas{
  display:block;
  width:100%;
  height:auto;
  background:#ffffff;
}

.output-strip-minimal{
  margin-top:8px;
}

.output-strip-compact{
  gap:6px;
}

.output-strip-compact .output-card{
  min-height:112px;
  padding:9px;
  border-radius:3px;
}

.output-strip-compact .output-card strong{
  margin:4px 0;
  font-size:0.78rem;
  letter-spacing:0.04em;
}

.output-strip-compact .output-card p{
  font-size:0.72rem;
  line-height:1.38;
}

.site-footer{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:4px 8px 0;
  color:#61707c;
  font-size:0.72rem;
  letter-spacing:0.05em;
  text-transform:uppercase;
}

/* Refined dark workstation theme */
.app-body{
  color:#dbe6ef;
  background:
    radial-gradient(circle at 8% 0%, rgba(42, 76, 107, 0.28), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(95, 118, 138, 0.16), transparent 24%),
    linear-gradient(180deg, #0b1118 0%, #111923 48%, #0d141c 100%);
}

.app-shell-page{
  border-color:#344453;
  background:#121b25;
  box-shadow:0 28px 70px rgba(0, 0, 0, 0.34);
}

.app-topbar,
.app-project-strip{
  border-color:#31404e;
  background:linear-gradient(180deg, #1d2a36 0%, #16232e 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.05);
}

.app-body .app-topbar{
  background:linear-gradient(180deg, #1d2a36 0%, #16232e 100%);
  border-color:#31404e;
  backdrop-filter:none;
}

.app-project-strip{
  background:linear-gradient(180deg, #18242f 0%, #111b25 100%) !important;
}

.app-topbar .site-brand,
.app-topbar .site-brand-copy strong,
.app-work-meta strong,
.editor-section-head h3,
.preview-panel h3,
.account-pill strong{
  color:#eef5fb;
}

.app-topbar .site-brand-copy span,
.app-work-meta span,
.app-project-copy .panel-kicker,
.field span,
.tool-row-compact .field span,
.editor-panel .field span,
.parameter-list-inline span,
.parameter-list span,
.editor-section-head .card-kicker,
.preview-panel .card-kicker,
.preview-panel-hero > .card-header::before{
  color:#8fa1b1;
}

.app-topbar .brand-mark{
  background:rgba(8,14,22,0.78);
  color:#f4f8fb;
}

.app-topbar-nav,
.editor-tabs,
.preview-panel-hero > .card-header::before{
  border-color:#344453;
  background:#101923;
}

.app-topbar-nav a,
.app-topbar-nav .nav-soon summary,
.editor-tab{
  border-color:#263542;
  color:#9aacba;
}

.app-topbar-nav a.is-current,
.editor-tab.is-active{
  background:#d5b06a;
  color:#111923;
}

.app-topbar-nav .nav-soon[open] summary,
.app-topbar-nav .nav-soon summary:hover{
  background:#1a2632;
  color:#edf5fb;
}

.app-topbar-actions .account-pill,
.editor-shell,
.preview-shell{
  border-color:#31404e;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    #17222d;
  background-size:18px 18px, 18px 18px, cover;
}

.editor-panel,
.utility-disclosure,
.preview-panel,
.preview-panel-hero,
.preview-panel-secondary{
  border-color:#344453;
  background:#1b2732;
}

.editor-panel-soft,
.editor-meta-bar,
.utility-disclosure{
  background:#16232e;
}

.view-panel[data-view="pattern"].is-active .editor-panel{
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    #1b2732;
  background-size:18px 18px, 18px 18px, cover;
}

.editor-compact-header,
.editor-section-head,
.preview-panel .card-header,
.parameter-list-compact div,
.utility-disclosure[open] summary,
.preview-panel-secondary .parameter-list-compact div{
  border-color:#31404e;
}

.field input,
.field select,
.tool-row-compact .field input,
.tool-row-compact .field select,
.editor-panel .field input,
.editor-panel .field select,
.app-project-fields .field input{
  border-color:#3b4c5b;
  background:#101923;
  color:#e4edf5;
}

.field input:focus,
.field select:focus{
  outline:1px solid #d5b06a;
  border-color:#d5b06a;
}

.ghost-button,
.tool-row-compact .ghost-button,
.preview-panel .ghost-button,
.zoom-tool-button{
  border-color:#3b4c5b;
  background:linear-gradient(180deg, #22313e, #17232e);
  color:#dce7ef;
}

.primary-button{
  border-color:#d5b06a;
  background:linear-gradient(180deg, #d5b06a, #a77b37);
  color:#111923;
}

.guide-pill,
.threading-summary-panel div,
.auth-summary,
.auth-status,
.local-projects-status{
  border-color:#344453;
  background:#15212c;
  color:#dbe6ef;
}

.threading-summary-panel span{
  color:#91a3b2;
}

.saved-workflow-panel{
  margin:8px 0 10px;
  border:1px solid rgba(213,176,106,0.32);
  border-radius:6px;
  background:linear-gradient(180deg, rgba(32,47,60,0.96), rgba(18,29,39,0.96));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.05);
  overflow:hidden;
}

.saved-workflow-panel summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:38px;
  padding:9px 12px;
  cursor:pointer;
  list-style:none;
  color:#f2f6f9;
}

.saved-workflow-panel summary::-webkit-details-marker{
  display:none;
}

.saved-panel-title{
  font-size:0.76rem;
  font-weight:800;
  letter-spacing:0.12em;
  text-transform:uppercase;
}

.saved-panel-meta{
  display:flex;
  align-items:center;
  gap:8px;
  color:#d5b06a;
  font-size:0.72rem;
  font-weight:700;
}

.saved-panel-chevron{
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border:1px solid rgba(213,176,106,0.34);
  border-radius:999px;
  font-size:0.68rem;
  line-height:1;
  transition:transform .16s ease;
}

.saved-workflow-panel[open] .saved-panel-chevron{
  transform:rotate(180deg);
}

.saved-panel-body{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  border-top:1px solid rgba(213,176,106,0.18);
  background:rgba(8,14,20,0.24);
}

.saved-panel-toolbar{
  display:grid;
  grid-template-columns:minmax(180px, 1fr) minmax(120px, 170px) auto;
  align-items:end;
  gap:10px;
}

.saved-panel-toolbar-colors{
  grid-template-columns:minmax(180px, 1fr) minmax(120px, 150px) minmax(120px, 150px) auto;
}

.saved-panel-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.saved-panel-actions .primary-button,
.saved-panel-actions .ghost-button{
  min-height:38px;
  padding:9px 12px;
}

.saved-panel-status{
  margin:0;
  padding:9px 11px;
  border-radius:5px;
  font-size:0.78rem;
}

.cloud-records-list{
  max-height:250px;
  gap:8px;
  overflow:auto;
  padding-right:4px;
}

.cloud-records-list .local-project-card{
  border-color:#2f4050;
  border-radius:6px;
  background:linear-gradient(180deg, rgba(23,35,46,0.98), rgba(15,24,33,0.98));
}

.cloud-records-list .local-project-card-head{
  align-items:center;
}

.cloud-records-list .local-project-card strong{
  color:#eff5f8;
  font-size:0.88rem;
}

.cloud-records-list .local-project-card small,
.cloud-records-list .local-project-card-meta{
  color:#98aaba;
}

.cloud-records-list .tiny-button{
  border-color:#394b5b;
  border-radius:5px;
  background:#182633;
  color:#e7eef5;
  font-size:0.76rem;
}

.cloud-records-list .tiny-button.is-danger{
  border-color:rgba(213,176,106,0.26);
  color:#f1c978;
}

.saved-cloud-color-line{
  align-items:center;
}

.saved-cloud-color-swatch{
  border-radius:5px;
  border-color:rgba(255,255,255,0.22);
}

.threading-summary-panel strong,
.parameter-list-inline strong,
.parameter-list strong{
  color:#edf5fb;
}

.zoom-tool-button:hover{
  border-color:#d5b06a;
  background:#233547;
}

.app-preview-stage{
  border-color:#3d5265;
  background:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(180deg, #111b25 0%, #0b121a 100%);
}

.app-preview-stage .fabric-overlay,
.preview-zoom-toolbar,
.measurement-info-panel{
  border-color:rgba(213,176,106,0.28);
  background:rgba(9, 15, 22, 0.78);
  backdrop-filter:blur(12px);
}

.preview-zoom-toolbar{
  position:absolute;
  right:6px;
  bottom:6px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:3px;
  padding:4px;
  border:1px solid rgba(213,176,106,0.24);
  border-radius:4px;
  box-shadow:0 10px 22px rgba(0,0,0,0.24);
}

.zoom-tool-button{
  min-width:28px;
  height:24px;
  padding:0 7px;
  border-radius:3px;
  font-size:0.66rem;
  font-weight:800;
  letter-spacing:0.06em;
  text-transform:uppercase;
}

.zoom-readout{
  min-width:42px;
  color:#d5b06a;
  font-size:0.64rem;
  font-weight:800;
  letter-spacing:0.08em;
  text-align:center;
}

.preview-action-row .ghost-button{
  background:#15212c;
}

.preview-action-row .ghost-button.is-active{
  border-color:#d5b06a;
  background:linear-gradient(180deg, #d5b06a, #a77b37);
  color:#111923;
}

.site-footer{
  color:#8497a7;
}

@media (max-width:1240px){
  .app-body{
    overflow:auto;
  }

  .app-shell-page{
    height:auto;
    min-height:calc(100vh - 16px);
    overflow:visible;
  }

  .app-workspace{
    grid-template-columns:1fr;
  }

  .preview-shell{
    min-height:680px;
  }

  .app-preview-stage{
    min-height:520px;
  }
}

@media (max-width:940px){
  html,
  body{
    max-width:100%;
    overflow-x:hidden;
  }

  .app-body{
    overflow:auto;
    overflow-x:hidden;
  }

  .app-shell-page{
    width:100%;
    max-width:100%;
    margin:0;
    padding:5px;
    overflow:hidden;
    border-left:none;
    border-right:none;
  }

  .app-shell-page,
  .app-shell-page *{
    max-width:100%;
  }

  .app-topbar,
  .app-topbar-main,
  .app-topbar-actions,
  .app-project-strip,
  .app-project-copy,
  .app-workspace,
  .editor-shell,
  .preview-shell{
    min-width:0;
  }

  .app-topbar,
  .app-topbar-main,
  .app-project-strip,
  .app-project-copy{
    flex-direction:column;
    align-items:stretch;
  }

  .app-topbar-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
    align-items:stretch;
    justify-content:stretch;
  }

  .app-topbar-actions .account-pill{
    grid-column:1 / -1;
    min-width:0;
  }

  .account-menu{
    width:100%;
  }

  .account-panel{
    position:static;
    width:100%;
    margin-top:6px;
  }

  .account-panel::before{
    display:none;
  }

  .account-plan-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .account-plan-row strong{
    text-align:left;
  }

  .app-topbar-actions .ghost-button,
  .app-topbar-actions .primary-button{
    width:100%;
    min-width:0;
    white-space:normal;
    font-size:0.62rem;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .app-topbar .site-brand{
    min-width:0;
  }

  .app-topbar-nav,
  .editor-tabs{
    width:calc(100vw - 20px);
    max-width:calc(100vw - 20px);
    overflow:hidden;
  }

  .app-topbar-nav{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .app-topbar-nav a{
    min-width:0;
    padding-inline:2px;
    text-align:center;
    white-space:normal;
    font-size:0.62rem;
  }

  .editor-tabs{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    overflow:hidden;
  }

  .editor-tab{
    min-width:0;
    padding-inline:2px;
    font-size:0.58rem;
  }

  .app-project-fields,
  .app-work-meta{
    flex-wrap:wrap;
  }

  .app-work-meta{
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
  }

  .app-work-meta strong,
  .app-work-meta span{
    white-space:normal;
  }

  .app-project-fields .field{
    flex:1 1 100%;
    min-width:0;
  }

  .tool-row,
  .tool-row-tight,
  .tool-row-compact{
    align-items:stretch;
  }

  .field,
  .tool-row-compact .field{
    flex:1 1 100%;
    min-width:0;
  }

  .view-panel[data-view="pattern"] .tool-row{
    grid-template-columns:1fr;
  }

  .technical-control-row{
    grid-template-columns:1fr;
  }

  .utility-grid,
  .threading-summary-panel,
  .parameter-list-inline,
  .parameter-list-inline-soft,
  .preview-action-row{
    grid-template-columns:1fr;
  }

  .editor-meta-bar{
    flex-direction:column;
    align-items:flex-start;
  }

  .preview-shell{
    min-height:560px;
  }

  .app-preview-stage{
    min-height:420px;
  }
}

/* Workstation polish pass */
.app-shell-page{
  width:min(1600px, calc(100vw - 18px));
  padding:7px;
  gap:7px;
  border-color:rgba(104,126,145,0.48);
  border-radius:10px;
  background:linear-gradient(180deg, #111b25 0%, #0d151e 100%);
  box-shadow:0 30px 80px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
}

.app-topbar,
.app-project-strip,
.editor-shell,
.preview-shell,
.editor-panel,
.preview-panel,
.utility-disclosure{
  border-radius:8px;
}

.app-topbar{
  min-height:48px;
  padding:7px 9px;
}

.app-project-strip{
  min-height:48px;
  padding:7px 10px;
}

.app-topbar-nav,
.editor-tabs,
.app-topbar-actions .account-pill,
.app-project-fields .field input,
.field input,
.field select,
.ghost-button,
.primary-button,
.zoom-tool-button{
  border-radius:6px;
}

.app-topbar-nav{
  gap:2px;
  padding:2px;
  background:rgba(9,15,22,0.7);
}

.app-topbar-nav a{
  border-right:none;
  border-radius:5px;
  min-width:88px;
  text-align:center;
}

.app-workspace{
  grid-template-columns:minmax(430px, 0.38fr) minmax(0, 1fr);
  gap:8px;
}

.editor-shell,
.preview-shell{
  padding:7px;
  gap:7px;
  border-color:rgba(91,113,132,0.56);
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(180deg, #182531 0%, #111b25 100%);
  background-size:20px 20px, 20px 20px, cover;
}

.editor-shell{
  overflow:hidden;
}

.view-panel{
  overflow:auto;
  scrollbar-width:thin;
  scrollbar-color:#465a6c transparent;
}

.view-panel::-webkit-scrollbar,
.cloud-records-list::-webkit-scrollbar,
.editor-tabs::-webkit-scrollbar{
  width:7px;
  height:7px;
}

.view-panel::-webkit-scrollbar-thumb,
.cloud-records-list::-webkit-scrollbar-thumb,
.editor-tabs::-webkit-scrollbar-thumb{
  background:#465a6c;
  border-radius:999px;
}

.editor-panel,
.preview-panel,
.utility-disclosure{
  border-color:rgba(86,108,127,0.56);
  background:linear-gradient(180deg, rgba(27,41,53,0.98), rgba(17,27,37,0.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.035), 0 14px 34px rgba(0,0,0,0.13);
}

.editor-panel{
  padding:10px;
}

.editor-section-head{
  margin-bottom:10px;
  padding-bottom:9px;
  border-color:rgba(88,110,129,0.42);
}

.editor-section-head .card-kicker,
.preview-panel .card-kicker,
.field span,
.tool-row-compact .field span,
.editor-panel .field span{
  letter-spacing:0.12em;
}

.editor-section-head h3,
.preview-panel h3{
  font-size:0.86rem;
  letter-spacing:0.08em;
}

.editor-tabs{
  gap:3px;
  padding:3px;
  border-color:rgba(85,107,126,0.6);
  background:#0d1620;
}

.editor-tab{
  min-height:32px;
  border-right:none;
  border-radius:5px;
  font-size:0.68rem;
}

.editor-meta-bar{
  min-height:42px;
  padding:7px 9px;
  border-color:rgba(86,108,127,0.5);
  background:linear-gradient(180deg, #162431, #111d28);
}

.parameter-list-inline{
  gap:8px;
}

.parameter-list-inline div{
  padding-left:8px;
  border-left:1px solid rgba(86,108,127,0.42);
}

.parameter-list-inline div:first-child{
  border-left:none;
  padding-left:0;
}

.tool-row,
.tool-row-tight,
.tool-row-compact{
  gap:9px;
  margin-bottom:10px;
}

.field input,
.field select,
.tool-row-compact .field input,
.tool-row-compact .field select,
.editor-panel .field input,
.editor-panel .field select,
.app-project-fields .field input{
  min-height:36px;
  padding:0 10px;
  border-color:rgba(91,113,132,0.72);
  background:linear-gradient(180deg, #101b26, #0c141d);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03);
}

.field-inline-value{
  margin-top:5px;
  color:#8295a7;
}

.ghost-button,
.primary-button,
.tool-row-compact .ghost-button,
.tool-row-compact .primary-button,
.preview-panel .ghost-button{
  min-height:36px;
  padding:8px 12px;
  border-radius:6px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.045), 0 8px 18px rgba(0,0,0,0.14);
}

.primary-button{
  background:linear-gradient(180deg, #d8b66f, #b98a3f);
}

.view-panel[data-view="pattern"] .tool-row{
  gap:10px;
}

.view-panel[data-view="armure"] .editor-panel > .tool-row:not(.technical-control-row){
  display:grid;
  grid-template-columns:minmax(170px, 1fr) minmax(86px, auto) minmax(118px, auto);
  align-items:end;
  gap:9px;
}

.technical-control-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  align-items:end;
  gap:9px;
}

.technical-control-row .primary-button{
  grid-column:1 / -1;
  width:100%;
}

.draft-preview-tight{
  padding:10px;
  border:1px solid rgba(86,108,127,0.5);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(13,22,31,0.72), rgba(8,14,20,0.66));
}

.draft-canvas{
  width:100%;
  max-width:100%;
  border-radius:7px;
  border-color:rgba(119,141,160,0.55);
}

.draft-guides-compact .guide-pill,
.guide-pill{
  border-radius:6px;
  border-color:rgba(91,113,132,0.58);
  background:#101b26;
}

.saved-workflow-panel{
  margin:12px 0 14px;
  border-color:rgba(213,176,106,0.28);
  border-radius:9px;
  background:
    linear-gradient(135deg, rgba(213,176,106,0.08), transparent 38%),
    linear-gradient(180deg, rgba(31,47,60,0.98), rgba(13,22,31,0.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.06), 0 16px 32px rgba(0,0,0,0.16);
}

.saved-workflow-panel summary{
  min-height:44px;
  padding:10px 13px;
}

.saved-panel-title{
  font-size:0.78rem;
}

.saved-panel-meta > span:first-child{
  padding:4px 8px;
  border:1px solid rgba(213,176,106,0.28);
  border-radius:999px;
  background:rgba(213,176,106,0.08);
}

.saved-panel-chevron{
  width:23px;
  height:23px;
  font-size:0;
}

.saved-panel-chevron::before{
  content:"";
  width:7px;
  height:7px;
  border-right:2px solid #d5b06a;
  border-bottom:2px solid #d5b06a;
  transform:rotate(45deg) translate(-1px, -1px);
}

.saved-workflow-panel[open] .saved-panel-chevron::before{
  transform:rotate(225deg) translate(-1px, -1px);
}

.saved-panel-body{
  gap:12px;
  padding:13px;
  border-color:rgba(213,176,106,0.16);
  background:rgba(5,10,16,0.22);
}

.saved-panel-toolbar,
.saved-panel-toolbar-colors{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.saved-panel-actions{
  grid-column:1 / -1;
  justify-content:flex-start;
}

.saved-panel-actions .primary-button,
.saved-panel-actions .ghost-button{
  min-height:34px;
  padding:8px 11px;
}

.saved-panel-status{
  padding:8px 10px;
  border-radius:6px;
  color:#b9c8d5;
}

.cloud-records-list{
  max-height:220px;
  padding-right:3px;
}

.cloud-records-list .local-project-card{
  padding:11px;
  border-color:rgba(86,108,127,0.52);
  border-radius:8px;
  background:
    linear-gradient(90deg, rgba(213,176,106,0.08), transparent 32%),
    linear-gradient(180deg, rgba(22,35,47,0.98), rgba(12,21,30,0.98));
}

.local-project-card-actions{
  gap:7px;
}

.cloud-records-list .tiny-button{
  min-height:30px;
  padding:7px 9px;
  border-radius:6px;
}

.preview-shell{
  gap:7px;
}

.preview-panel{
  padding:8px;
}

.preview-panel-hero > .card-header{
  grid-template-columns:auto minmax(190px, 1fr) auto;
  gap:10px;
  min-height:42px;
  margin-bottom:7px;
  padding-bottom:7px;
}

.preview-panel-hero > .card-header::before{
  display:none;
  content:none;
}

.preview-meta-strip{
  flex:0 0 auto;
  display:flex;
  width:max-content;
  max-width:100%;
  margin-bottom:7px;
  overflow:hidden;
  border:1px solid rgba(91,113,132,0.55);
  border-radius:999px;
  background:rgba(9,15,22,0.64);
}

.preview-meta-strip span{
  padding:5px 10px;
  border-right:1px solid rgba(91,113,132,0.42);
  color:#9fb1c0;
  font-size:0.58rem;
  font-weight:800;
  letter-spacing:0.1em;
  text-transform:uppercase;
}

.preview-meta-strip span:last-child{
  border-right:none;
  color:#d5b06a;
}

.app-preview-stage{
  border-radius:8px;
  border-color:rgba(87,110,130,0.72);
}

.app-preview-stage .fabric-overlay{
  inset:10px auto auto 10px;
  max-width:min(320px, calc(100% - 20px));
  padding:7px 9px;
  border-radius:7px;
  background:rgba(8,14,20,0.68);
}

.fabric-overlay strong{
  font-size:0.64rem;
}

.fabric-overlay p{
  max-width:260px;
  font-size:0.58rem;
}

.measurement-info-panel{
  left:10px;
  right:auto;
  bottom:10px;
  max-width:min(310px, calc(100% - 180px));
  padding:8px 10px;
  border-radius:7px;
  background:rgba(8,14,20,0.66);
}

.measurement-info-panel strong{
  margin-top:0;
  font-size:0.74rem;
  color:#fff4db;
}

.measurement-info-panel span{
  margin-top:4px;
  color:#9db0bf;
  font-size:0.52rem;
}

.measurement-info-panel p{
  font-size:0.56rem;
  color:#879bab;
}

.preview-zoom-toolbar{
  right:10px;
  bottom:10px;
  border-radius:7px;
  background:rgba(8,14,20,0.72);
}

.preview-action-row{
  gap:5px;
  margin-top:7px;
}

.app-topbar-actions .language-switcher-compact{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border:1px solid #aeb8c2;
  border-radius:4px;
  background:#edf1f4;
}

.app-topbar-actions .language-switcher-compact button{
  min-width:30px;
  height:26px;
  padding:0 8px;
  border:0;
  border-radius:3px;
  background:transparent;
  color:#52606d;
  font-size:0.68rem;
  font-weight:800;
  letter-spacing:0.08em;
  cursor:pointer;
}

.app-topbar-actions .language-switcher-compact button.is-active{
  background:#172535;
  color:#f4f7fa;
}

.preview-panel-secondary .parameter-list-compact div{
  padding:7px 10px;
}

@media (min-width:1241px) and (max-width:1420px){
  .app-workspace{
    grid-template-columns:minmax(410px, 0.36fr) minmax(0, 1fr);
  }

  .editor-panel{
    padding:9px;
  }
}

@media (max-width:1240px){
  .app-workspace{
    grid-template-columns:1fr;
  }
}

@media (max-width:940px){
  .saved-panel-toolbar,
  .saved-panel-toolbar-colors,
  .view-panel[data-view="armure"] .editor-panel > .tool-row:not(.technical-control-row),
  .technical-control-row{
    grid-template-columns:1fr;
  }

  .technical-control-row .primary-button,
  .saved-panel-actions{
    grid-column:auto;
  }

  .measurement-info-panel{
    max-width:calc(100% - 20px);
    bottom:54px;
  }

  .preview-zoom-toolbar{
    left:10px;
    right:auto;
    max-width:calc(100% - 20px);
    overflow:auto hidden;
  }
}

@media (max-width:720px){
  html,
  body,
  .app-body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  .app-shell-page{
    width:100%;
    max-width:100vw;
    min-height:100vh;
    margin:0;
    padding:6px;
    gap:8px;
    border-radius:0;
    box-sizing:border-box;
    overflow-x:hidden;
  }

  .app-shell-page,
  .app-shell-page *{
    box-sizing:border-box;
  }

  .app-topbar{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    padding:8px;
  }

  .app-topbar-main,
  .app-topbar-actions,
  .app-project-strip,
  .app-workspace,
  .editor-shell,
  .preview-shell{
    width:100%;
    max-width:100%;
  }

  .app-topbar .site-brand{
    width:100%;
    min-width:0;
    gap:9px;
  }

  .app-topbar .site-brand-copy strong{
    font-size:0.86rem;
    letter-spacing:0;
    white-space:normal;
  }

  .app-topbar .site-brand-copy span{
    font-size:0.58rem;
    line-height:1.3;
  }

  .app-topbar-nav{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
    max-width:100%;
    gap:4px;
    overflow:visible;
    padding:4px;
  }

  .app-topbar-nav a,
  .app-topbar-nav .nav-soon,
  .app-topbar-nav .nav-soon summary{
    min-width:0;
    width:100%;
  }

  .app-topbar-nav a,
  .app-topbar-nav .nav-soon summary{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    padding:7px 6px;
    font-size:0.62rem;
    line-height:1.2;
    letter-spacing:0.08em;
    text-align:center;
    white-space:normal;
  }

  .app-topbar-nav .nav-soon-popover{
    position:fixed;
    left:10px;
    right:10px;
    top:118px;
    width:auto;
    max-width:none;
  }

  .app-topbar-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
  }

  .app-topbar-actions .language-switcher-compact{
    width:100%;
    justify-content:center;
  }

  .account-menu{
    grid-column:1;
    min-width:0;
  }

  .app-topbar-actions .account-pill{
    width:100%;
    min-width:0;
    min-height:34px;
    padding:5px 7px;
  }

  .app-topbar-actions > .ghost-button,
  .app-topbar-actions > .primary-button{
    grid-column:1 / -1;
    min-height:36px;
    font-size:0.66rem;
  }

  .account-panel{
    width:100%;
    max-width:100%;
    padding:10px;
  }

  .auth-actions,
  .account-plan-row{
    display:grid;
    grid-template-columns:1fr;
  }

  .app-project-strip{
    gap:10px;
    padding:10px;
  }

  .app-project-copy{
    gap:7px;
  }

  .app-project-copy .panel-kicker{
    white-space:normal;
  }

  .app-work-meta strong{
    font-size:0.72rem;
    line-height:1.35;
    white-space:normal;
  }

  .app-work-meta span{
    font-size:0.62rem;
    line-height:1.35;
    white-space:normal;
  }

  .app-project-fields{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    width:100%;
  }

  .app-project-fields .field{
    width:100%;
    min-width:0;
    flex-basis:auto;
  }

  .app-project-fields .field input,
  .field input,
  .field select,
  .editor-panel .field input,
  .editor-panel .field select{
    min-height:42px;
    font-size:0.86rem;
  }

  .app-workspace{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    min-height:0;
  }

  .editor-shell,
  .preview-shell{
    min-height:auto;
    padding:7px;
    overflow:visible;
  }

  .editor-tabs{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
    max-width:100%;
    gap:4px;
    overflow:visible;
    padding:4px;
  }

  .editor-tab{
    min-width:0;
    min-height:38px;
    padding:7px 6px;
    font-size:0.65rem;
    line-height:1.2;
    white-space:normal;
  }

  .view-panel{
    overflow:visible;
  }

  .editor-panel,
  .preview-panel{
    padding:9px;
  }

  .editor-meta-bar,
  .editor-compact-header,
  .editor-section-head,
  .preview-panel .card-header,
  .preview-panel-hero > .card-header{
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
    align-items:start;
  }

  .editor-section-head h3,
  .preview-panel h3{
    font-size:0.82rem;
    line-height:1.3;
  }

  .parameter-list-inline,
  .parameter-list-inline-soft,
  .preview-panel-secondary .parameter-list-compact{
    grid-template-columns:1fr;
  }

  .parameter-list-inline div{
    padding-left:0;
    border-left:none;
  }

  .tool-row,
  .tool-row-tight,
  .tool-row-compact,
  .view-panel[data-view="pattern"] .tool-row,
  .view-panel[data-view="armure"] .editor-panel > .tool-row:not(.technical-control-row),
  .technical-control-row,
  .utility-grid,
  .threading-summary-panel,
  .saved-panel-toolbar,
  .saved-panel-toolbar-colors{
    display:grid;
    grid-template-columns:1fr;
    gap:9px;
  }

  .ghost-button,
  .primary-button,
  .preview-panel .ghost-button,
  .saved-panel-actions .primary-button,
  .saved-panel-actions .ghost-button{
    width:100%;
    min-height:42px;
    white-space:normal;
  }

  .draft-preview-tight{
    padding:8px;
  }

  .draft-guides-compact{
    display:grid;
    grid-template-columns:1fr;
  }

  .saved-workflow-panel{
    margin:10px 0;
  }

  .saved-workflow-panel summary{
    grid-template-columns:1fr auto;
    gap:8px;
    padding:10px;
  }

  .saved-panel-meta{
    flex-wrap:wrap;
  }

  .saved-panel-body{
    padding:10px;
  }

  .saved-panel-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .cloud-records-list{
    max-height:none;
    padding-right:0;
  }

  .cloud-records-list .local-project-card,
  .local-project-card-head,
  .local-project-card-actions,
  .saved-cloud-color-line{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .preview-shell{
    min-height:auto;
  }

  .preview-meta-strip{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    border-radius:8px;
  }

  .preview-meta-strip span{
    min-width:0;
    border-right:none;
    border-bottom:1px solid rgba(91,113,132,0.42);
    text-align:center;
  }

  .preview-meta-strip span:last-child{
    border-bottom:none;
  }

  .app-preview-stage{
    min-height:330px;
    max-height:56vh;
  }

  .app-preview-stage .fabric-overlay{
    inset:8px 8px auto 8px;
    max-width:none;
  }

  .fabric-overlay p{
    max-width:none;
    line-height:1.35;
  }

  .measurement-info-panel{
    left:8px;
    right:8px;
    bottom:58px;
    max-width:none;
  }

  .preview-zoom-toolbar{
    left:8px;
    right:8px;
    bottom:8px;
    justify-content:center;
  }

  .preview-action-row{
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
  }

  .preview-panel-secondary .parameter-list-compact div{
    padding:9px;
  }

  .color-picker-panel{
    gap:12px;
    padding:14px;
  }

  .color-picker-field{
    height:220px;
  }

  .color-picker-hue{
    height:30px;
  }

  .color-picker-hue-handle{
    height:38px;
  }

  .color-picker-open,
  .color-picker-close,
  .color-picker-hex input{
    min-height:42px;
  }

  .site-footer{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    padding:10px 8px 2px;
  }
}

@media (max-width:380px){
  .app-shell-page{
    padding:5px;
  }

  .app-topbar-nav a,
  .app-topbar-nav .nav-soon summary,
  .editor-tab{
    font-size:0.6rem;
  }

  .app-preview-stage{
    min-height:300px;
  }
}
