/* Tessera workspace: presentation only. DOCX typography and data stay in the document model. */
@font-face {
  font-family: Inter;
  src: url('../assets/fonts/inter-400.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('../assets/fonts/inter-500.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('../assets/fonts/inter-600.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
:root {
  --brand: var(--teal);
  --ink: var(--text);
  --canvas: var(--paper-bg);
  --line: var(--border);
  --soft: var(--done);
  --panel: 292px;
  --outline-width: 224px;
  --control-radius: 5px;
}
.studio-shell {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  grid-template-rows: auto auto minmax(0, 1fr);
}
.studio-shell button,
.studio-shell input,
.studio-shell select,
.studio-shell textarea {
  font-family: inherit;
}
.studio-shell .appbar.compactheader {
  display: flex;
  flex-wrap: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.studio-shell .compactheader.appbar::after {
  display: none;
}
.studio-shell .compactheader .wordmark {
  border: 0;
  padding: 0;
  min-width: 126px;
}
.studio-breadcrumb {
  font-size: 12px;
  color: var(--muted);
  padding: 0 0 0 17px !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  height: 24px;
  min-height: 24px !important;
  flex: none;
}
.studio-shell .compactheader .documentidentity {
  flex: 1 1 240px;
  min-width: 90px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
}
.studio-shell #docName {
  max-width: 100%;
  color: var(--ink);
  padding: 3px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
}
.studio-shell #documentTitleInput {
  font-size: 13px;
  max-width: 100%;
  width: 100%;
  padding: 4px;
  min-height: 30px;
}
.studio-shell #saveState {
  line-height: 1.4;
  margin: 0 4px;
  white-space: nowrap;
}
.studio-shell .appbar > .headerfill {
  display: none;
}
.studio-modes {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.studio-shell .studio-modes button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  border: 0;
  box-shadow: none;
  white-space: nowrap;
  background: transparent;
  transition: color 140ms ease;
}
.studio-shell .studio-modes button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 140ms ease;
}
.studio-shell .studio-modes button:hover {
  background: transparent;
  color: var(--ink);
}
.studio-shell .studio-modes button.studio-mode-active {
  box-shadow: none;
}
.studio-shell .studio-modes button.studio-mode-active::after {
  transform: scaleX(1);
}
.studio-shell #sideCount {
  font-size: 10px;
  background: var(--canvas);
  padding: 1px 4px;
  color: var(--finding-text);
}
.studio-shell #sideCount.zero {
  display: none;
}
.studio-shell #export {
  gap: 7px;
  font-size: 12px;
  background: var(--brand);
  color: var(--surface);
  border: 0;
  flex: none;
}
.studio-shell #export svg {
  width: 15px;
  height: 15px;
}
.studio-shell .exportshort {
  display: none;
}
.studio-shell .exportfull {
  display: inline;
}
.studio-commandbar {
  display: flex;
  align-items: center;
  background: var(--surface);
}
.studio-commandbar .workspaceMenus {
  display: flex;
  flex: none;
  align-items: center;
  overflow: visible;
  margin: 0;
}
.studio-commandbar .workspaceMenus summary,
.studio-commandbar .workspaceMenus > button {
  font-size: 12px;
  padding: 6px 8px;
  min-height: 30px;
  color: var(--muted);
  background: transparent;
  border-radius: 4px;
}
.studio-commandbar .workspaceMenus .filemenu {
  position: relative;
}
.studio-commandbar .workspaceMenus .menupopup {
  top: calc(100% + 5px);
  left: 0;
  right: auto;
  min-width: 235px;
  max-height: min(70dvh, 600px);
  overflow-y: auto;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 7%, transparent);
}
/* Menus live inside the toolbar, but must not inherit compact formatting buttons. */
.studio-commandbar .workspaceMenus .menupopup {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.studio-commandbar .workspaceMenus .menupopup > button {
  display: flex;
  flex: none;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 36px;
  padding: 9px 10px;
  gap: 8px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  font: 400 12px/1.4 var(--ui-font, Inter, sans-serif);
}
.studio-commandbar .workspaceMenus .menupopup > button > svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}
.studio-commandbar .workspaceMenus .menushortcuthelp {
  justify-content: space-between;
}
.studio-commandbar .workspaceMenus .menuseparator {
  flex: none;
}
@media (pointer: coarse) {
  .studio-commandbar .workspaceMenus .menupopup > button {
    min-height: 44px;
  }
}
.studio-outline-toggle {
  width: 30px;
  height: 30px;
  padding: 6px !important;
  min-height: 30px;
  border: 0;
  color: var(--muted);
  flex: none;
}
.studio-outline-toggle[aria-expanded='true'] {
  background: var(--canvas);
  color: var(--ink);
}
.studio-insertions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.studio-insertions button {
  gap: 6px;
  color: var(--muted);
  border-radius: 4px;
}
.studio-insertions svg {
  width: 14px;
  height: 14px;
}
.studio-insertions[hidden] {
  display: none;
}
.studio-shell .formatbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 12;
  position: relative;
}
.studio-shell .texttoolrow {
  display: flex;
  align-items: center;
  height: auto;
  overflow: visible;
}
.studio-shell .edittools .toolcluster {
  gap: 3px;
}
.studio-shell .edittools .toolcluster + .toolcluster {
  padding-left: 9px;
  border-color: var(--line);
}
.studio-shell .edittools button,
.studio-shell .edittools .selectcontrol {
  border-radius: 4px;
  font-size: 12px;
  min-height: 30px;
  height: 30px;
}
.studio-shell .edittools .emphasiscluster button[id^='format-'] {
  height: 30px;
  min-height: 30px;
}
.studio-shell .fontcluster .selectcontrol {
  max-width: 135px;
  min-width: 60px;
  padding: 5px 8px;
}
.studio-shell .fontcluster .selectcontrol[data-select-for='fontSize'] {
  max-width: 65px;
}
.studio-shell .documenttoolrow {
  display: none;
}
.studio-shell.studio-preview .texttoolrow {
  display: none;
}
.studio-shell .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--canvas);
}
.studio-shell .workspace.outline-open {
  grid-template-columns: var(--outline-width) minmax(0, 1fr);
}
.studio-shell .workspace.panel-open {
  grid-template-columns: minmax(0, 1fr) var(--panel);
}
.studio-shell .workspace.outline-open.panel-open {
  grid-template-columns: var(--outline-width) minmax(0, 1fr) var(--panel);
}
.studio-outline {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.studio-outline[hidden] {
  display: none;
}
.studio-outline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 17px;
  flex: none;
}
.studio-outline-heading strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.studio-outline-heading button {
  font-size: 18px;
  color: var(--muted);
  padding: 4px;
  min-height: 28px;
  width: 28px;
}
.studio-outline-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 0 9px 20px;
}
.studio-outline .outlineitem {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 4px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.studio-outline .outlineitem[data-level='2'] {
  padding-left: 17px;
}
.studio-outline .outlineitem[data-level='3'] {
  padding-left: 25px;
}
.studio-outline .outlineitem.active {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 500;
}
.studio-outline .outlineitem:hover {
  background: var(--canvas);
  color: var(--ink);
}
.studio-outline-resize {
  position: absolute;
  right: 0;
  top: 54px;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}
.studio-outline-resize:hover,
.studio-outline-resize:focus-visible {
  background: var(--line);
  outline: none;
}
.studio-shell .documentarea {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.studio-shell .pageworkbench {
  flex: 1;
  min-height: 0;
  background: var(--canvas);
}
.studio-shell .paperscroll {
  padding: 30px 30px 44px;
  scroll-padding-top: 24px;
  background: var(--canvas);
}
.studio-shell .documentpage {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 5px color-mix(in srgb, var(--ink) 3%, transparent);
  border-radius: 0;
}
.studio-shell .paper .chip:not(.invalid):not(.condition) {
  border: 0;
  border-radius: 3px;
  padding: 1px 3px;
}
.studio-shell .paper .condition {
  border: 1px dashed var(--line);
  background: var(--canvas);
  color: var(--muted);
  border-radius: 3px;
}
.studio-shell .paper .docselected {
  box-shadow: none;
  border-left: 0;
  background: transparent;
}
.studio-shell .tableactions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  padding: 5px 0;
}
.studio-shell .tableactions button {
  font-size: 10px;
  min-height: 30px;
  padding: 5px 8px;
  background: transparent;
  color: var(--muted);
}
.studio-shell .inspector {
  width: auto;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  position: relative;
  height: auto;
  top: auto;
  right: auto;
  bottom: auto;
  z-index: 18;
}
.studio-shell .inspector[hidden] {
  display: none;
}
.studio-shell .panelheader {
  border-bottom: 1px solid var(--line);
}
.studio-shell .panelheader h2 {
  color: var(--muted);
}
.studio-shell .inspectorview {
  padding: 14px;
}
.studio-shell #fieldPopover.docked-field-properties {
  position: static !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  max-height: none !important;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: var(--surface);
}
.studio-shell #fieldPopover[hidden] {
  display: none !important;
}
.studio-shell .issue {
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0;
  background: transparent;
}
.studio-shell .checkoverview {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--canvas);
  padding: 12px;
  font-size: 12px;
}
.studio-shell .canvasfooter {
  background: var(--surface);
  border-color: var(--line);
}
.studio-shell .previewapplications {
  min-height: 45px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.studio-shell .previewnotice {
  background: var(--canvas);
  color: var(--muted);
  border: 0;
}
.studio-shell .homemain {
  padding-top: 36px;
}
.studio-shell .hometemplate > strong,
.studio-shell .homedocname strong {
  font-size: 12px;
  font-weight: 500;
}
.studio-shell dialog {
  border: 1px solid var(--line);
  box-shadow: 0 18px 80px color-mix(in srgb, var(--ink) 11%, transparent);
}
.studio-shell dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  backdrop-filter: none;
}
.studio-shell button:focus-visible,
.studio-shell summary:focus-visible,
.studio-shell [tabindex]:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}
@media (max-width: 1200px) {
  .studio-shell {
    --panel: 270px;
  }
  .studio-shell .appbar.compactheader {
    gap: 9px;
    padding: 0 16px;
  }
  .studio-shell .documentidentity {
    max-width: 220px;
  }
  .studio-breadcrumb {
    display: none;
  }
  .studio-shell .paperscroll {
    padding: 24px 20px 35px;
  }
  .studio-shell .texttoolrow {
    gap: 5px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .studio-shell .edittools .toolcluster + .toolcluster {
    padding-left: 6px;
  }
  .studio-shell .fontcluster .selectcontrol {
    max-width: 105px;
  }
}
@media (max-width: 1050px) {
  .studio-shell .workspace.outline-open,
  .studio-shell .workspace.outline-open.panel-open,
  .studio-shell .workspace.panel-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-shell .studio-outline {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 21;
    box-shadow: 7px 0 18px color-mix(in srgb, var(--ink) 5%, transparent);
  }
  .studio-outline-resize {
    display: none;
  }
  .studio-shell .inspector {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    box-shadow: -5px 0 18px color-mix(in srgb, var(--ink) 5%, transparent);
  }
  .studio-shell .texttoolrow {
    flex-wrap: wrap;
    gap: 5px;
  }
  .studio-shell .studio-modes button {
    padding: 6px 10px;
  }
  .studio-shell .compactheader .documentidentity {
    max-width: none;
    flex: 1;
    min-width: 80px;
  }
  .studio-shell .studio-modes {
    margin-left: 0;
  }
  .studio-shell .appbar.compactheader {
    height: 62px;
    min-height: 62px;
  }
}
@media (max-width: 600px) {
  .studio-shell .appbar.compactheader {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    grid-template-rows: 36px 34px;
    height: 90px;
    min-height: 90px;
    padding: 8px 12px;
    gap: 3px 8px;
    align-items: center;
  }
  .studio-shell .compactheader .wordmark {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .studio-shell .compactheader .wordmark .tesseralogo {
    font-size: 20px;
  }
  .studio-shell .compactheader .documentidentity {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: auto;
  }
  .studio-shell #docName {
    font-size: 12px;
  }
  .studio-shell #saveState {
    display: none;
  }
  .studio-shell #export {
    grid-column: 3;
    grid-row: 1;
    width: 34px;
    height: 32px;
    min-height: 32px;
    padding: 8px;
  }
  .studio-shell #export .exportfull,
  .studio-shell #export .exportshort {
    display: none;
  }
  .studio-shell .studio-modes {
    grid-column: 1/4;
    grid-row: 2;
    justify-self: stretch;
    justify-content: center;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0;
    gap: 10px;
  }
  .studio-shell .studio-modes button {
    font-size: 12px;
    flex: 1;
    height: 30px;
    padding: 5px 4px;
  }
  .studio-commandbar {
    padding: 5px 10px;
    gap: 6px;
    min-height: 40px;
    flex-wrap: nowrap;
  }
  .studio-commandbar .workspaceMenus {
    gap: 0;
  }
  .studio-commandbar .workspaceMenus summary {
    font-size: 11px;
    padding: 5px;
    min-height: 29px;
  }
  .studio-commandbar .workspaceMenus #layoutMenu,
  .studio-commandbar .workspaceMenus #displayMenu {
    display: none;
  }
  .studio-insertions {
    padding-left: 7px;
    margin-left: auto;
    gap: 0;
  }
  .studio-insertions button {
    font-size: 11px;
    padding: 5px;
    gap: 3px;
    min-height: 32px;
  }
  .studio-insertions svg {
    width: 12px;
    height: 12px;
  }
  .studio-shell .texttoolrow {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 4px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 38px;
  }
  .studio-shell #mobileFormatting {
    display: none;
  }
  .studio-shell .edittools .toolcluster {
    flex: none;
  }
  .studio-shell .settingscluster {
    display: none;
  }
  .studio-shell .paragraphcluster {
    display: flex;
  }
  .studio-shell .fontcluster .selectcontrol {
    max-width: 95px;
  }
  .studio-shell .edittools .toolcluster + .toolcluster {
    padding-left: 5px;
  }
  .studio-shell .paperscroll {
    padding: 12px 10px 24px;
    scroll-padding: 12px;
  }
  .studio-shell .paper {
    font-size: 15px;
    line-height: 1.6;
  }
  .studio-shell .paper .editable-text {
    min-height: 1.5em;
  }
  .studio-shell .mobile-flow .documentpage,
  .studio-shell.mobile-flow .documentpage {
    border: 0;
    box-shadow: none;
  }
  .studio-shell .inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: min(72dvh, 650px);
    border: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 45px color-mix(in srgb, var(--ink) 9%, transparent);
    z-index: 65;
  }
  .studio-shell .panelheader {
    min-height: 48px;
  }
  .studio-shell .studio-outline {
    width: min(85vw, 290px);
  }
  .studio-shell .previewapplications {
    padding: 7px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .studio-shell .previewapplications #sampleKind {
    display: none;
  }
  .studio-shell .previewnotice {
    padding: 6px 12px;
  }
  .studio-shell .canvasfooter {
    padding: 4px 10px;
  }
  .studio-shell .canvasfooter .engineLabel {
    font-size: 9px;
  }
  .studio-shell dialog {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(var(--app-height, 100dvh) - 16px);
    padding: 20px 16px;
    border-radius: 12px;
    bottom: auto;
  }
  .studio-shell .menupopup {
    max-width: calc(100vw - 24px);
  }
  .studio-shell .simpletabledialog .modalactions {
    bottom: -20px;
  }
  .studio-shell #insertPopover {
    left: 6px !important;
    right: 6px !important;
    top: 132px !important;
    bottom: auto;
    width: auto !important;
    max-height: calc(var(--app-height, 100dvh) - 146px);
  }
  .studio-shell .homebar {
    padding: 14px 18px;
  }
  .studio-shell .homemain {
    padding: 26px 18px;
  }
  .studio-shell .homegrid {
    gap: 23px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .studio-shell *,
  .studio-shell *::before,
  .studio-shell *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.usedfields {
  border-bottom: 1px solid var(--line);
  margin: 0 0 12px;
  padding-bottom: 10px;
}
.detailstoggle {
  cursor: pointer;
  font-size: 11px;
  color: var(--text, var(--ink));
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
  text-align: left;
}
.usedfieldrow {
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--canvas);
  border-radius: 0;
  text-align: left;
  font-size: 11px;
}
.usedfieldrow small {
  font-size: 10px;
  color: var(--muted);
  flex: none;
}
.fieldsourceadvanced {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.fieldsourceadvanced p,
.fieldsourceadvanced code {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.usedfieldrow .usedfieldsource {
  display: block;
  font-weight: 400;
  font-size: 10px;
  margin-top: 3px;
  color: var(--muted);
}

.detailstoggle:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tabularfilebutton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
.tabularfilebutton input {
  width: 100%;
  font: inherit;
}
.tabularfilebutton input::file-selector-button {
  padding: 8px 12px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.tableeditcanvas .tabledataactions {
  flex-wrap: wrap;
}

/* Header controls belong to the document, not the application form palette. */
.studio-shell .doctable table tr:first-child > td {
  position: relative;
}
.studio-shell .inline-table-heading {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 2px 3px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
}
.studio-shell .inline-table-heading:hover {
  background: color-mix(in srgb, var(--ink) 2%, transparent);
}
.studio-shell .inline-table-heading:focus {
  outline: 1px solid var(--line);
  outline-offset: 0;
  background: var(--surface);
  box-shadow: none;
}

.tabledata-dialog {
  width: min(1040px, calc(100vw - 32px));
}
.gridtools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.gridtools span {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.table-data-grid {
  max-height: 55dvh;
  overflow: auto;
  border: 1px solid var(--line);
}
.table-data-grid table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table-data-grid th,
.table-data-grid td {
  border-bottom: 1px solid var(--line);
  padding: 7px;
  text-align: left;
}
.table-data-grid thead th {
  position: sticky;
  top: 0;
  background: var(--canvas);
  z-index: 1;
  font-weight: 500;
}
.table-data-grid input {
  width: 100%;
  min-width: 120px;
  min-height: 34px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font: inherit;
}
.table-data-grid input:hover {
  border-color: var(--line);
}
.table-data-grid input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: none;
}
.table-data-grid input[aria-invalid='true'] {
  border-color: var(--finding-text);
  background: var(--canvas);
}
.grid-cell-error {
  display: block;
  font-size: 10px;
  color: var(--finding-text);
  padding: 3px 7px;
}
.grid-row-actions {
  white-space: nowrap;
}
.grid-row-actions button {
  font-size: 11px;
  padding: 6px;
  border: 0;
  background: transparent;
}
.table-data-grid tfoot {
  background: var(--canvas);
  font-weight: 500;
}
.gridpaging {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
}
.gridempty {
  padding: 16px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .table-data-grid {
    max-height: 48dvh;
  }
  .grid-row-actions button {
    min-height: 40px;
  }
}

.studio-shell #saveState[role='button'] {
  color: var(--finding-text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.year-sources {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.year-sources > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  align-items: center;
}
.year-sources span {
  font-size: 11px;
  color: var(--muted);
}
.year-sources strong {
  grid-column: 1;
  font-size: 12px;
  font-weight: 500;
}
.year-sources button {
  grid-column: 2;
  grid-row: 1 / 3;
}
.year-summary {
  font-size: 12px;
}
.year-review-list,
.coverage-list {
  max-height: 48dvh;
  overflow: auto;
}
.year-review-row,
.coverage-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.year-review-row > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.year-review-row strong,
.coverage-row strong {
  font-size: 13px;
  font-weight: 500;
}
.year-review-row span,
.coverage-row p {
  font-size: 12px;
  color: var(--muted);
}
.year-review-row > button {
  margin-top: 9px;
}
.year-review-row label {
  margin-top: 8px;
  font-size: 12px;
}
.coverage-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.impactlist .impact-before {
  color: var(--muted, var(--muted));
}
.impactlist .impact-after {
  color: var(--ink);
}
.impact-after > span {
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.inline-table-controls {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font:
    12px/1.4 Inter,
    sans-serif;
  color: var(--ink);
}
.inline-table-controls-head,
.inline-table-control-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}
.inline-table-controls-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 4px;
}
.inline-table-control-row > label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.inline-table-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.inline-table-controls button {
  min-width: 30px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.inline-table-controls button:hover {
  background: var(--canvas);
}
.inline-table-controls button[aria-pressed='true'] {
  border-color: var(--brand);
  color: var(--brand);
}
.inline-table-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.quick-table-sources {
  display: grid;
  gap: 6px;
}
.quick-table-sources button {
  text-align: left;
  padding: 12px;
}

.batchdialog {
  max-width: 780px;
}
.batch-results {
  max-height: 52dvh;
  overflow: auto;
}
.batch-application {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.batch-application-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.batch-application-head strong,
.batch-application-head span {
  display: block;
}
.batch-application-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.batch-issue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 0 0 12px;
}
.batch-issue > div {
  flex: 1 1 260px;
}
.batch-issue strong {
  font-size: 13px;
}
.batch-issue p {
  margin: 3px 0;
  font-size: 12px;
}
.batch-issue small {
  color: var(--muted);
}
.batch-coverage {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.batch-coverage p {
  font-size: 12px;
  margin: 5px 0;
}
#previewTestAll {
  margin-left: auto;
}
@media (max-width: 600px) {
  .batch-application-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .batch-issue {
    padding-left: 0;
  }
}

.dependency-places {
  display: grid;
  gap: 4px;
  max-height: 55dvh;
  overflow: auto;
}
.dependency-places button {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
}
.dependency-places button strong,
.dependency-places button span {
  display: block;
}
.dependency-places button span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.guardlead {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--ink);
}
.guardcards {
  display: grid;
}
.guardcard {
  display: flex;
  flex-direction: column;
}
.guardcard h2 {
  margin: 0;
  color: var(--ink);
}
.guardcard p {
  flex: 1;
  margin: 0;
}
.guardcard div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.guardcard .guardlink {
  border: 0;
  background: none;
}

.templatesummary h3 {
  margin: 16px 0 6px;
  font-size: 13px;
  color: var(--ink);
}
.templatesummary ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.templatesummary li + li {
  margin-top: 4px;
}

.generationreport {
  margin: 4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
}
.generationreport h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.generationreport ul {
  margin: 8px 0 12px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

/* Readability options (Zobrazenie): larger controls and stronger contrast for long sessions. */
:root[data-text-size='large']
  :is(.appbar, .formatbar, #inspector, #insertPopover, #modal, #workspaceHome) {
  zoom: 1.15;
}
:root[data-contrast='high'] {
  --ink: var(--text);
  --muted: var(--text-secondary);
  --line: var(--border);
  --brand: var(--teal);
  --brand-hover: var(--ink);
}
:root[data-contrast='high'] body,
:root[data-contrast='high'] :is(.micro, small, p, label, .guardcard p) {
  color: var(--ink);
}
:root[data-contrast='high'] :is(button, input, select, textarea) {
  border-color: var(--muted);
}

/* Finding actions are secondary buttons: an earlier layer left a dark fill under brand-colored
   text, which made "Ukázať miesto" and "Vybrať náhradu" hard to read. */
.issue .issueactions .action {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
}
.issue .issueactions .action:hover {
  background: var(--soft);
}

.previewnotice #downloadSample {
  margin-left: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
}

.tablelayouts,
.blockcolumns {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 24px 0;
  padding: 0;
  border: 0;
}
.tablelayouts legend,
.blockcolumns legend {
  margin-bottom: 12px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
dialog .blockcolumns {
  gap: 0;
}
dialog .blockcolumns .checkline {
  margin: 0;
  padding: 8px 0;
}
dialog .tablelayouts label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
dialog .tablelayouts label:hover {
  background: var(--canvas);
}
dialog .tablelayouts label:has(input:checked) {
  background: var(--soft);
}
dialog .tablelayouts input[type='radio'] {
  appearance: auto;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.tablelayouts span {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.tablelayouts strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}
.tablelayouts small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

/* Tessera two-piece mark and wordmark in the application typeface. */
.tesseralogo {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-size: 30px;
  line-height: 1;
}
.tesseralogo .tesseramark {
  flex: none;
}
.tesseralogo .tesserawordmark {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1em;
  font-weight: 600;
  color: var(--ink);
}
.homebrand .tesseralogo {
  margin-left: 0;
}

/* Dlaždik beside the home lead, the check summary and the bulk-generation report. */
.mascot {
  flex: none;
  width: 56px;
  height: auto;
}
.guardintro {
  display: flex;
}
.guardintro .guardlead {
  margin: 0;
}
.checkoverview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.checkoverview > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.generationreport {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.generationreport .mascot {
  width: 64px;
}

/* "Opraviť bezpečné" under the check summary. */
.checkoverview .fixsafe {
  align-self: flex-start;
  margin-top: 6px;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
}

/* Fill-in spots of an imported Word contract. */
.placeholderintro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.placeholderintro h2 {
  margin-top: 0;
}
.placeholderlist {
  max-height: 46vh;
  overflow: auto;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.placeholderlist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 230px);
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.placeholderlist li.chosen {
  background: var(--soft);
}
.placeholdercontext {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.placeholdercontext mark {
  background: var(--soft);
  color: var(--finding-text);
  border-radius: 3px;
  padding: 0 2px;
}
.placeholderlist select {
  width: 100%;
  margin: 0;
}
@media (max-width: 560px) {
  .placeholderlist li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* "/" menu at the caret. */
.slashmenu {
  position: fixed;
  z-index: 25;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--ink) 15%, transparent);
  box-sizing: border-box;
}
.slashmenu[hidden] {
  display: none;
}
.slashmenu .search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  padding: 0 10px;
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  background: var(--canvas);
}
.slashmenu .search:focus-within {
  box-shadow: inset 0 0 0 1px var(--brand);
}
.slashmenu .search input:focus-visible {
  outline: none;
}
.slashmenu .slashmark {
  color: var(--brand);
  font-weight: 600;
}
.slashmenu input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  padding: 8px 0;
  outline: none;
}
#slashResults {
  max-height: 280px;
  overflow: auto;
}
#slashResults .field {
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 5px;
}
#slashResults .field[aria-selected='true'] {
  background: var(--soft);
}
#slashResults .empty {
  margin: 8px;
  font-size: 12px;
}
.slashhint {
  margin: 4px 6px 2px;
  font-size: 11px;
  color: var(--muted);
}

/* Tessera presentation system. Layout and interface only; document metrics stay intact. */
:root {
  --brand: var(--teal);
  --brand-hover: var(--ink);
  --brand-subtle: var(--soft);
  --blue: var(--brand);
  --bluehover: var(--brand-hover);
  --red: var(--finding-text);
  --green: var(--brand);
  --control-radius: 8px;
}
body,
button,
input,
select,
textarea {
  font-family: Inter, sans-serif;
}
body {
  font-size: 13px;
  line-height: 1.5;
}
button,
summary,
.selectcontrol {
  min-height: 32px;
}
button,
input,
select,
textarea,
.search {
  border-radius: 6px;
}
.studio-shell button:focus-visible,
.studio-shell summary:focus-visible,
.studio-shell [tabindex]:focus-visible,
:root[data-input-mode='keyboard'] :is(input, textarea, select, [contenteditable]):focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 3px;
}
:root input[type='checkbox'] {
  accent-color: var(--brand);
}

/* Home: one clear starting point, followed by a compact document library. */
.studio-shell #workspaceHome {
  background: var(--surface);
}
.studio-shell .homebar {
  height: 72px;
  padding: 0 max(32px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.homebar > div {
  gap: 8px;
}
.homebar button {
  min-height: 36px;
  padding: 8px 16px;
}
.homebar button.primary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.homebar button.primary:hover:not(:disabled) {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--muted);
}
.studio-shell .homemain {
  max-width: 1184px;
  padding: 48px 32px 64px;
}
.homeguard {
  margin: 0 0 48px;
}
.guardintro {
  gap: 16px;
  margin-bottom: 28px;
  align-items: center;
}
.guardintro .guardlead {
  max-width: 720px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.guardcards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.guardcard {
  position: relative;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}
.guardcard:first-child {
  background: var(--surface);
  border: 1px solid var(--line);
}
.guardcard h2 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.guardcard p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.guardcard > .guardactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.guardcard button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 36px;
}
.guardcard button[data-guard='check'],
.guardcard button[data-guard='year'] {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.guardcard button[data-guard='check']:hover,
.guardcard button[data-guard='year']:hover {
  background: var(--canvas);
  border-color: var(--muted);
}
.guardcard .guardlink {
  color: var(--muted);
  text-decoration: none;
  padding-left: 4px;
  padding-right: 4px;
}
.guardcard .guardlink:hover {
  color: var(--brand);
  background: var(--canvas);
}
.guardcard .guardillustration {
  width: 64px;
  height: 48px;
  margin-bottom: 4px;
  color: var(--brand);
  stroke-width: 1.5;
  flex: none;
}
.guardillustration .illustration-paper {
  fill: var(--surface);
}
.guardillustration .illustration-back {
  fill: var(--soft);
  stroke: var(--mint);
}
.guardillustration .illustration-highlight {
  fill: var(--soft);
  stroke: none;
}
.studio-shell .homeheading {
  gap: 12px;
  margin-bottom: 20px;
}
.studio-shell .homeheading h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.homesearch {
  width: 256px;
  min-height: 36px;
  background: var(--canvas);
  border-color: transparent;
}
.homesearch input {
  font-size: 12px;
  padding: 8px 0;
}
.homesearch:focus-within {
  border-color: var(--brand);
  background: var(--surface);
}
.homesortmenu summary {
  width: 36px;
  height: 36px;
}
.homebrand {
  text-decoration: none;
}
.homeback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -12px 0 12px -10px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.homeback:hover {
  color: var(--brand);
  background: var(--canvas);
}
.homeback svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}
.hometabs {
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 12px;
}
.hometabs button {
  font-size: 13px;
  min-height: 40px;
  padding: 8px 12px;
}
:root .hometabs button[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: transparent;
  background: var(--canvas);
  border-radius: 6px;
}
.studio-shell .homegrid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
}
.hometemplate {
  justify-content: flex-start;
  padding: 0;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.hometemplate:hover {
  color: var(--ink);
  background: transparent;
}
/* Delete sits on the paper, next to the card button: a button cannot hold another one. */
.homecard {
  position: relative;
  display: flex;
  min-width: 0;
}
.homecard > .hometemplate {
  flex: 1;
  min-width: 0;
}
.homedelete {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  opacity: 0;
}
.homecard:hover .homedelete,
.homedelete:focus-visible {
  opacity: 1;
}
.homedelete:hover:not(:disabled) {
  border-color: var(--finding-text);
  background: var(--surface);
  color: var(--finding-text);
}
.homedelete svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (hover: none), (pointer: coarse) {
  .homedelete {
    width: 44px;
    height: 44px;
    opacity: 1;
  }
}
.studio-shell .hometemplate .homepaper,
.studio-shell .homerecentcard .homepaper {
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
.studio-shell .hometemplate:hover .homepaper {
  border-color: var(--line);
  box-shadow: none;
}
.studio-shell .hometemplate > strong,
.studio-shell .homerecentcard .homedocname strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.homerecentcard .homedocname {
  gap: 4px;
  padding: 0;
}
.homerecentcard .homedocname small,
.hometemplate small {
  font-size: 12px;
}

/* Workspace: two compact tool rows, restrained active states, uncluttered paper. */
.studio-shell .appbar.compactheader {
  min-height: 64px;
  height: 64px;
  padding: 0 24px;
  gap: 16px;
}
.studio-shell #docName {
  font-size: 14px;
  font-weight: 500;
}
.studio-shell #saveState {
  font-size: 12px;
  color: var(--muted);
}
.studio-shell .studio-modes {
  gap: 4px;
}
.studio-shell .studio-modes button {
  border-radius: 6px;
  padding: 8px 12px;
  min-height: 36px;
  height: 36px;
}
.studio-shell .studio-modes button.studio-mode-active {
  background: var(--canvas);
  color: var(--ink);
}
.studio-shell .studio-modes button::after {
  display: none;
}
.studio-shell #export {
  min-height: 36px;
  height: 36px;
  padding: 8px 16px;
  border-radius: 6px;
  box-shadow: none;
}
.studio-commandbar {
  padding: 4px 24px;
  min-height: 44px;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.studio-commandbar .workspaceMenus {
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}
.studio-commandbar .workspaceMenus summary,
.studio-commandbar .workspaceMenus > button,
.studio-outline-toggle {
  min-height: 32px;
  border-radius: 6px;
}
.studio-commandbar .studio-insertions {
  flex: 0 0 auto;
  flex-basis: auto;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0 0 0 12px;
  border-top: 0;
  border-left: 1px solid var(--line);
}
.studio-insertions button {
  min-height: 32px;
  height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.studio-shell .texttoolrow {
  gap: 8px;
  padding: 6px 24px;
  min-height: 44px;
  flex-wrap: wrap;
}
.studio-shell .edittools button,
.studio-shell .edittools .selectcontrol,
.studio-shell .edittools .emphasiscluster button[id^='format-'] {
  min-height: 32px;
  height: 32px;
  border-radius: 6px;
}
.studio-shell .edittools .emphasiscluster button[id^='format-'] {
  width: 32px;
}
:root .edittools button[aria-pressed='true'] {
  background: var(--soft);
  color: var(--brand);
}
.studio-shell .paperscroll {
  padding-top: 32px;
  padding-bottom: 48px;
}
.templatepaper,
.documentpage,
.studio-shell .documentpage,
#pageThumbnails .thumbnailviewport {
  box-shadow: none;
  border: 1px solid var(--line);
}
.studio-shell .canvasfooter {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 12px;
}
.studio-shell .previewnotice {
  padding: 12px 24px;
  font-size: 12px;
  line-height: 1.6;
}
.studio-shell .previewapplications {
  padding: 8px 24px;
  gap: 12px;
}
.studio-shell .panelheader {
  min-height: 56px;
  padding: 12px 20px;
}
.studio-shell .panelheader h2 {
  font-size: 14px;
  font-weight: 600;
}
.field small,
.micro,
.issuegroup > h2,
.fieldsection {
  font-size: 12px;
}
.checkoverview,
.generationreport {
  padding: 16px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
.issuegroup > h2 {
  color: var(--ink);
  font-weight: 600;
}
.issueactions .action,
.issue .action {
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 36px;
  border-radius: 6px;
}
.issueactions .action:hover,
.issue .action:hover {
  background: var(--soft);
  color: var(--brand);
}
#insertPopover,
.slashmenu,
.menupopup,
.selectpopup {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 12%, transparent);
}

/* Embedded data remains legible without competing with document typography. */
.studio-shell .paper .chip,
.paper .chip {
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--brand);
  background: var(--soft);
  border-bottom: 1px solid var(--mint);
}
.studio-shell .paper .chip:not(.invalid):not(.condition) {
  color: var(--brand);
  background: var(--soft);
  border-color: var(--mint);
}
.studio-shell .paper .chip.invalid,
.paper .chip.invalid {
  color: var(--finding-text);
  background: var(--finding-bg);
  border-bottom: 1px dashed var(--finding);
}
.paper .chip.invalid::after {
  background: var(--finding-text);
  color: var(--surface);
}
.mascot,
.generationreport .mascot,
.placeholderintro .mascot {
  width: 40px;
  height: 40px;
  max-height: 40px;
  object-fit: contain;
  opacity: 1;
  animation: none;
  transition: none;
  display: inline-block;
  background-repeat: no-repeat;
}
.mascot-hello {
  background-image: url('../assets/mascot/tessera-hello-transparent.png');
  background-size: cover;
  background-position: center;
}
.mascot-found,
.mascot-done {
  background-size: contain;
  background-position: center;
}
.mascot-found {
  background-image: url('../assets/mascot/tessera-found-transparent.png');
}
.mascot-done {
  background-image: url('../assets/mascot/tessera-done-transparent.png');
}
.guardintro .mascot {
  width: 72px;
  height: 72px;
  max-height: 72px;
}
.studio-shell dialog {
  border-radius: 8px;
  padding: 32px;
  background: var(--surface);
}
.studio-shell dialog h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.modalactions {
  gap: 8px;
  padding-top: 20px;
}

@media (max-width: 1100px) {
  .studio-shell .appbar.compactheader {
    gap: 8px;
    padding: 0 16px;
  }
  .studio-shell .studio-modes button {
    padding-left: 8px;
    padding-right: 8px;
  }
  .studio-commandbar,
  .studio-shell .texttoolrow {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 720px) {
  .studio-commandbar .studio-insertions {
    flex-basis: 100%;
    margin: 0;
    padding: 4px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .guardcards {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .guardcard {
    padding: 20px;
  }
  .guardcard > div {
    margin-top: 0;
  }
  .studio-shell .homemain {
    padding: 32px 24px 48px;
  }
  .guardintro .guardlead {
    font-size: 20px;
  }
  .homeguard {
    margin-bottom: 32px;
  }
  .studio-shell .homegrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 600px) {
  .studio-shell .appbar.compactheader {
    height: auto;
    min-height: 104px;
    padding: 8px 12px;
    gap: 4px 8px;
  }
  .studio-shell .studio-modes {
    gap: 4px;
  }
  .studio-shell .studio-modes button {
    min-height: 44px;
    height: 44px;
  }
  .studio-shell #export {
    min-height: 44px;
    height: 44px;
    width: 44px;
    padding: 8px;
  }
  .studio-shell .homebar {
    height: 64px;
    padding: 0 20px;
  }
  .homebar button {
    min-height: 44px;
    padding: 8px 12px;
  }
  .studio-shell .homemain {
    padding: 28px 20px 40px;
  }
  .guardintro {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
  }
  .studio-shell .homeheading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .studio-shell .homeheading h1 {
    flex-basis: 100%;
    font-size: 24px;
  }
  .studio-shell .homeheading .homesearch {
    margin-left: 0;
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .hometabs {
    margin-bottom: 20px;
  }
  .studio-shell .texttoolrow {
    flex-wrap: wrap;
    overflow: visible;
  }
  .studio-shell .formatbar.edittools {
    max-height: none;
  }
  .studio-shell .edittools button,
  .studio-shell .edittools .selectcontrol,
  .studio-shell .edittools .emphasiscluster button[id^='format-'],
  .studio-commandbar .workspaceMenus summary,
  .studio-commandbar .workspaceMenus > button,
  .studio-commandbar .studio-insertions button,
  .studio-outline-toggle,
  button,
  summary,
  .selectcontrol {
    min-height: 44px;
  }
  .studio-commandbar .studio-insertions {
    justify-content: space-between;
  }
  .studio-commandbar .studio-insertions button {
    flex: 1;
  }
  .studio-shell dialog {
    max-width: calc(100vw - 24px);
    padding: 24px;
  }
}
@media (max-width: 560px) {
  .mascot {
    display: none;
  }
  .guardintro .mascot {
    display: block;
  }
  .placeholderlist li {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 420px) {
  .studio-shell .homegrid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (pointer: coarse) {
  button,
  summary,
  .selectcontrol,
  .selectoption {
    min-height: 44px;
  }
}

.studio-shell .homemain {
  background: var(--surface);
}
.studio-shell .hometemplate,
.studio-shell .hometemplate:hover {
  background: transparent;
}
.studio-shell .homesearch {
  border-color: var(--line);
  background: var(--surface);
}

@media (max-width: 600px) {
  .studio-shell .homebar {
    height: auto;
    min-height: 64px;
    padding: 16px 20px;
    gap: 8px 16px;
  }
}

@media (max-width: 600px) {
  .studio-shell .appbar.compactheader {
    grid-template-rows: auto auto;
  }
  .studio-shell .compactheader .wordmark .tesseralogo {
    display: inline-flex;
  }
  .studio-shell .compactheader .wordmark .tesserawordmark {
    display: inline;
  }
  .studio-shell #export svg {
    display: block;
    width: 16px;
    height: 16px;
  }
}

/* Keep the existing logo intact inside the legacy wordmark wrapper. */
.studio-shell .compactheader .wordmark .tesseralogo,
.studio-shell .compactheader .wordmark .tesserawordmark {
  border: 0;
  padding: 0;
  margin: 0;
}
@media (max-width: 600px) {
  .studio-shell #export svg {
    display: block !important;
  }
}

/* A decision diamond with two outcomes distinguishes conditions from Git branches. */
.studio-insertions svg:has(use[href='#i-branch']) {
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 4 4-4 4-4-4zM12 10v4M6 20v-6h12v6m-15-3 3 3 3-3m6 0 3 3 3-3'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.studio-insertions svg:has(use[href='#i-branch']) use {
  visibility: hidden;
}

/* Shared two-piece mark across the home, editor and favicon. */
.tesseralogo .tesseramark {
  display: block;
  width: 1.15em;
  height: 0.88em;
  object-fit: contain;
}
.tesseralogo {
  gap: 0.32em;
}
.tesseralogo .tesserawordmark {
  letter-spacing: -0.045em;
}
.homebrand .tesseralogo {
  font-size: 28px;
}
.compactheader .wordmark .tesseralogo {
  font-size: 24px;
}
@media (max-width: 600px) {
  .studio-shell .compactheader .wordmark .tesseralogo {
    font-size: 20px;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .guardcard > .guardactions {
    min-height: 80px;
    align-content: flex-start;
  }
}

/* Review workspace: readable findings and a clear repair hierarchy. */
@media (min-width: 1051px) {
  .studio-shell:has(#checkPane:not([hidden])) {
    --panel: 336px;
  }
}
.studio-shell #checkPane {
  padding: 16px 20px 24px;
}
#checkPane #issues {
  padding: 0;
}
#checkPane .usedfields {
  margin: 0 0 16px;
  padding-bottom: 0;
  border-bottom: 0;
}
#checkPane .detailstoggle {
  min-height: 32px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
}
.studio-shell #checkPane .checkoverview {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
#checkPane .checkoverview:has(.mascot-done) {
  background: var(--soft);
}
#checkPane .checkoverview > div {
  min-width: 0;
  gap: 0;
}
#checkPane .checkoverview strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
#checkPane .checkoverview span {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
#checkPane .checkoverview .fixsafe {
  align-self: stretch;
  width: 100%;
  margin: 12px 0 0;
  padding: 8px 12px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
  box-shadow: none;
}
#checkPane .checkoverview .fixsafe:hover:not(:disabled) {
  background: var(--soft);
  border-color: var(--brand);
}
#checkPane .issuegroup > h2 {
  align-items: center;
  gap: 8px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
#checkPane .issuegroup > h2 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
#checkPane .issuegrouphelp {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}
.studio-shell #checkPane .issue {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
#checkPane .issue:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
#checkPane .issueseverity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--finding-bg);
  color: var(--finding-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
#checkPane .issueseverity::before {
  content: '';
  width: 12px;
  height: 12px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2 15 14H1ZM8 6v4M8 12v.1'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
#checkPane .issue.notice .issueseverity {
  color: var(--muted);
  background: var(--canvas);
}
#checkPane .issue .issuetop h3 {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}
#checkPane .issue p {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
#checkPane .proposal {
  display: block;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#checkPane .location {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
#checkPane .issueactions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-top: 12px;
}
#checkPane .issueactions .action {
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
}
#checkPane .issueactions .action:hover:not(:disabled) {
  background: var(--canvas);
  border-color: var(--brand);
}
#checkPane .issueactions .action[data-jump] {
  align-self: flex-start;
  justify-content: flex-start;
  width: auto;
  min-height: 32px;
  padding: 4px 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 400;
}
#checkPane .issueactions .action[data-jump]:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}
#checkPane .checkextras {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
#checkPane .checkextras h2 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
#checkPane .checkextras button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 36px;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  white-space: normal;
}
#checkPane .checkextras button strong {
  font-weight: 600;
}
#checkPane .checkextras button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#checkPane .checkextras button:hover {
  color: var(--ink);
  background: var(--canvas);
}
@media (min-width: 601px) and (max-width: 1050px) {
  .studio-shell .inspector:has(#checkPane:not([hidden])) {
    width: 336px;
    max-width: 100%;
  }
}
@media (max-width: 560px) {
  .studio-shell #checkPane .checkoverview {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (pointer: coarse), (max-width: 600px) {
  #checkPane .issueactions .action,
  #checkPane .detailstoggle,
  #checkPane .checkoverview .fixsafe,
  #checkPane .checkextras button {
    min-height: 44px;
  }
}

/* On-demand help stays separate from the editor's document dialogs. */
.studio-shell .appbar > .help-button,
.homebar .help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}
.studio-shell .appbar > .help-button:hover,
.homebar .help-button:hover {
  background: var(--canvas);
  color: var(--ink);
}
.studio-shell dialog.help-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.studio-shell dialog.help-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}
.help-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.help-dialog .help-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.help-dialog .help-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.help-close {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 24px;
  color: var(--muted);
}
.help-content {
  padding: 24px;
}
.help-practice {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.help-practice h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-weight: 600;
}
.help-dialog .help-practice > p {
  margin: 12px 0 20px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.help-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--surface);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.help-start:hover {
  background: var(--ink);
}
.help-topics-title {
  margin: 24px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.help-topic {
  border-bottom: 1px solid var(--line);
}
.help-topic summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 17px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  list-style: none;
}
.help-topic-number {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.help-topic summary::-webkit-details-marker {
  display: none;
}
.help-topic summary::after {
  content: '+';
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  text-align: center;
}
.help-topic[open] summary::after {
  content: '−';
}
.help-topic[open] summary {
  color: var(--brand);
}
.help-topic ol {
  margin: 0 0 20px 34px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.help-topic li {
  padding-left: 4px;
}
.help-topic li + li {
  margin-top: 12px;
}
.help-dialog .help-footnote {
  margin: 24px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* A self-contained practice document: no access to drafts or autosave. */
.practice-page {
  display: block;
  min-height: 100dvh;
  height: auto;
  overflow: auto;
  background: var(--canvas);
  color: var(--ink);
}
.practice-header {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.practice-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.045em;
}
.practice-brand img {
  flex: none;
}
.practice-badge {
  color: var(--muted);
  font-size: 12px;
}
.practice-exit {
  margin-left: auto;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.practice-exit:hover {
  background: var(--canvas);
  color: var(--ink);
}
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(280px, 336px);
  justify-content: center;
  gap: 32px;
  max-width: 1200px;
  margin: auto;
  padding: 32px;
  align-items: start;
}
.practice-canvas {
  min-width: 0;
}
.practice-document {
  min-height: 640px;
  padding: 56px 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  font:
    16px/1.8 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.practice-document h1 {
  margin: 0 0 40px;
  font:
    600 20px/1.5 Georgia,
    serif;
  text-align: center;
}
.practice-document p {
  margin: 0 0 24px;
}
.practice-document p:last-child {
  margin-top: 48px;
  color: var(--muted);
  font:
    12px/1.6 Inter,
    sans-serif;
}
.practice-chip {
  display: inline;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--brand);
  font:
    500 12px/1.8 Inter,
    sans-serif;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.practice-chip-invalid {
  background: var(--finding-bg);
  color: var(--finding-text);
  border-bottom: 1px dashed var(--finding);
}
.practice-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.practice-coach {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding: 20px 0 20px 24px;
  border-left: 1px solid var(--line);
}
.practice-coach .mascot {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
}
.practice-steps {
  display: grid;
  gap: 0;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.practice-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.practice-steps li > span {
  display: inline-grid;
  flex: none;
  width: 20px;
  height: 20px;
  place-items: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.practice-steps .current {
  color: var(--ink);
  font-weight: 600;
}
.practice-steps .current > span {
  border-radius: 4px;
  background: var(--soft);
  color: var(--brand);
}
.practice-steps .complete > span {
  color: var(--brand);
}
.practice-progress {
  display: block;
  width: 100%;
  height: 3px;
  margin: 20px 0;
  appearance: none;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
  color: var(--brand);
}
.practice-progress::-webkit-progress-bar {
  background: var(--line);
}
.practice-progress::-webkit-progress-value {
  background: var(--brand);
}
.practice-progress::-moz-progress-bar {
  background: var(--brand);
}
.practice-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.practice-note,
.practice-feedback {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.practice-feedback:empty {
  display: none;
}
.practice-feedback {
  color: var(--brand);
}
.practice-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 500;
}
.practice-coach select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  font:
    13px Inter,
    sans-serif;
}
.practice-return {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--surface);
  font-size: 13px;
  text-decoration: none;
}
.practice-return:hover {
  background: var(--ink);
}
.practice-page :is(button, a, select):focus-visible,
.help-dialog :is(button, a, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
#practiceTitle:focus {
  outline: none;
}
@media (max-width: 900px) {
  .practice-layout {
    gap: 20px;
    padding: 24px;
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .practice-document {
    padding: 40px 24px;
  }
}
@media (max-width: 600px) {
  .studio-shell .appbar.compactheader:has(> .help-button) {
    grid-template-columns: 100px minmax(0, 1fr) 44px 44px;
    gap: 4px 6px;
  }
  .studio-shell .compactheader:has(> .help-button) #export {
    grid-column: 4;
  }
  .studio-shell .compactheader:has(> .help-button) .studio-modes {
    grid-column: 1 / -1;
  }
  .studio-shell .appbar > .help-button {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .homebar .help-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .help-heading,
  .help-content {
    padding: 20px;
  }
  .help-close,
  .help-start {
    min-height: 44px;
  }
  .practice-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
  }
  .practice-brand {
    font-size: 20px;
  }
  .practice-badge {
    font-size: 12px;
  }
  .practice-exit {
    margin-left: auto;
    font-size: 12px;
    padding: 8px 0;
  }
  .practice-layout {
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 24px;
  }
  .practice-coach {
    position: static;
    order: -1;
    width: 100%;
    padding: 0 0 20px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .practice-canvas {
    width: 100%;
  }
  .practice-coach .mascot {
    display: none;
  }
  .practice-guidehead {
    grid-template-columns: minmax(0, 1fr);
  }
  .practice-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }
  .practice-document {
    min-height: 480px;
    padding: 32px 20px;
    font-size: 14px;
  }
  .practice-document h1 {
    font-size: 16px;
  }
  .practice-page button,
  .practice-exit {
    min-height: 44px;
  }
}

/* Kontrola: status summary, findings by severity, passed checks, repair confirmation. */
#checkPane .checkoverview.checksummary {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
#checkPane .checksummary.is-ready {
  background: var(--soft);
  border-color: var(--mint);
}
#checkPane .checksummary.is-blocked {
  border-color: var(--finding);
}
#checkPane .checkoverview > .summaryhead {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
#checkPane .summaryhead .mascot {
  width: 52px;
  height: 52px;
  max-height: 52px;
}
#checkPane .summaryhead > div {
  min-width: 0;
}
#checkPane .checksummary strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
#checkPane .checksummary .summaryhead span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
#checkPane .checkcounts {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
#checkPane .checkcounts li {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}
#checkPane .checkcounts b {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}
#checkPane .checkcounts .is-error b {
  color: var(--finding-text);
}
#checkPane .checkcounts .is-zero b {
  color: var(--muted);
}
#checkPane .checkcounts .is-ok b {
  color: var(--brand);
}
#checkPane .checksummary .fixsafe {
  width: 100%;
  margin: 12px 0 0;
  min-height: 38px;
}
#checkPane .checksummary .checknote {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
#checkPane .repairnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--mint);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}
#checkPane .repairnote svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--brand);
}
#checkPane .repairnote span {
  flex: 1;
}
.linkbutton {
  padding: 4px 6px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkbutton:hover:not(:disabled) {
  background: var(--soft);
}
#checkPane .issuegroup {
  margin-top: 20px;
}
#checkPane .issuegroup > h2 {
  margin: 0 0 2px;
  font-size: 13px;
}
#checkPane .issuegrouphelp {
  margin: 0 0 10px;
}
.finding {
  position: relative;
  margin: 0 0 10px;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--surface);
}
.finding.is-error {
  border-left-color: var(--finding-text);
}
.finding.is-warning {
  border-left-color: var(--finding);
}
.finding[data-finding] {
  cursor: pointer;
}
.finding[data-finding]:hover {
  border-color: var(--teal);
}
.finding.is-current {
  box-shadow: 0 0 0 2px var(--teal);
}
.finding .findingtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.findingbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--finding-bg);
  color: var(--finding-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.findingbadge svg {
  width: 11px;
  height: 11px;
}
.finding .location {
  margin: 0;
  font-size: 11px;
}
.finding h3 {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.finding p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.finding .findingfix {
  color: var(--ink);
}
.finding .findingfix b {
  font-weight: 600;
}
.finding .findingproposal {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink);
}
.findingactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.findingactions .primary {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}
.checkpassed {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.checkpassed summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
.checkpassed summary span {
  font-weight: 400;
  color: var(--muted);
}
.checkpassed ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.checkpassed li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
}
.checkpassed li svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex: none;
  color: var(--brand);
}
.paper .issuefocus {
  animation: none;
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  background: var(--soft);
  transition: outline-color 0.4s;
}

/* Export: template and filled-contract status before download. */
.exportlead {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--canvas);
  font-size: 13px;
  line-height: 1.55;
}
.exportlead.is-blocked {
  background: var(--finding-bg);
}
.exportlead.is-ready {
  background: var(--soft);
}
.exportchecks {
  margin: 0 0 6px;
  border-top: 1px solid var(--line);
}
.exportchecks > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.exportchecks dt {
  font-size: 12px;
  font-weight: 600;
}
.exportchecks dd {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.exportchecks dd svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 2px;
}
.exportchecks .is-ok svg {
  color: var(--brand);
}
.exportchecks .is-warn svg,
.exportchecks .is-error svg {
  color: var(--finding-text);
}
.exportopenhead {
  margin: 14px 0 4px;
  font-size: 12px;
}
.exportopen {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.exportopen li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.exportopen li span,
.exportopen .more {
  color: var(--muted);
}

/* Practice contract: the same tabs and names as the real editor. */
.practice-appbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.practice-docname {
  font-size: 14px;
  font-weight: 600;
}
.practice-tabs,
.practice-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.practice-tools {
  margin-left: auto;
}
.practice-tabs button,
.practice-tools button {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
}
.practice-tabs [aria-selected='true'] {
  background: var(--soft);
  color: var(--brand);
  font-weight: 600;
}
.practice-tabs [aria-disabled='true'] {
  color: var(--muted);
  opacity: 0.6;
}
.practice-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--finding-bg);
  color: var(--finding-text);
  font-size: 11px;
  font-weight: 600;
}
.practice-next {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--surface);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.practice-page .primary {
  background: var(--brand);
  color: var(--surface);
}
.practice-page :is(.practice-next, .primary):is(:hover, :active):not(:disabled) {
  background: #09585c;
  color: var(--surface);
}
.practice-document .practice-insert-slot {
  display: inline;
  padding: 2px 3px;
  margin-left: 4px;
  border: 0;
  border-bottom: 1px dashed var(--brand);
  border-radius: 0;
  background: transparent;
  color: var(--brand);
  font:
    500 12px/1.6 Inter,
    sans-serif;
  vertical-align: baseline;
}
.practice-document .practice-insert-slot:hover {
  background: var(--soft);
}
.practice-popover {
  position: fixed;
  z-index: 20;
  width: 320px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(24, 43, 50, 0.16);
}
.practice-popover[hidden] {
  display: none;
}
.practice-popover-title {
  margin: 4px 8px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.practice-guidehead {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.practice-guidehead .mascot {
  width: 52px;
  height: 52px;
  max-height: 52px;
  margin: 0;
}
.practice-guidehead strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.practice-guidehead h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.practice-guidehead span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.practice-instruction {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}
.practice-done {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}
.practice-condition {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: baseline;
  margin: 16px 0 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
}
.practice-condition b {
  color: var(--ink);
  font-weight: 600;
}
.practice-document .practice-conditional {
  margin-top: 0;
  padding: 8px 0 0;
}
.practice-why {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--soft);
  color: var(--ink);
}
.practice-why.is-hidden {
  background: var(--canvas);
}
.practice-note code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.practice-note + .practice-guidehead {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.practice-dialog-lead {
  margin: 0 0 12px;
  color: var(--muted);
}
.practice-rule {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.practice-amount {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.practice-amount input {
  width: 120px;
}
@media (max-width: 600px) {
  .practice-amount {
    display: flex;
    width: 100%;
  }
  .practice-amount input {
    flex: 1;
    width: auto;
  }
}
.practice-dialog-error {
  margin: 12px 0 0;
  color: var(--finding-text);
  font-size: 13px;
}
.practice-dialog-error:empty {
  display: none;
}
.practice-coach .checksummary .mascot {
  width: 52px;
  height: 52px;
  max-height: 52px;
  margin: 0;
}
.practice-coach .finding {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .practice-appbar {
    padding: 8px 24px;
  }
}
@media (max-width: 600px) {
  .practice-appbar {
    padding: 8px 12px;
  }
  .practice-tools {
    margin-left: 0;
  }
}

/* Dialogs: one width, padding, heading, close button and action placement. */
dialog#modal {
  padding: 28px 32px 24px;
  border-radius: 12px;
}
dialog#modal:not([class]),
dialog#modal.exportdialog {
  width: min(520px, calc(100vw - 24px));
}
dialog#modal h2 {
  margin: 0 40px 16px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}
dialog#modal .close {
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 8px;
}
dialog#modal label:not(.checkline) {
  margin: 16px 0 6px;
}
dialog#modal .modalactions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
dialog#modal .modalactions button {
  min-width: 96px;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}
/* Distinct states: enabled and disabled buttons, selected option, error. */
dialog#modal .modalactions .primary:disabled {
  opacity: 1;
  background: var(--canvas);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}
dialog#modal :is(select, input:not([type='checkbox']):not([type='radio']), textarea):focus-visible {
  border-color: var(--teal);
  outline: 2px solid var(--teal) !important;
  outline-offset: -2px;
  box-shadow: none;
}
dialog#modal [aria-invalid='true'],
dialog#modal .is-invalid {
  border-color: var(--finding-text);
  background: var(--finding-bg);
}
dialog#modal .fielderror {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--finding-text);
}
dialog#modal .tablelayouts label:has(input:checked) {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}
dialog#modal .tablelayouts label {
  grid-template-columns: 16px minmax(0, 1fr) 72px;
  align-items: center;
}
dialog#modal .tablelayouts label > span {
  display: grid;
  gap: 2px;
}
dialog#modal .tablelayouts small {
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}
.layoutpreview {
  width: 72px;
  height: 48px;
}
@media (max-width: 600px) {
  dialog#modal {
    padding: 20px 16px 16px;
  }
  dialog#modal .modalactions button {
    min-height: 44px;
    flex: 1;
  }
  dialog#modal .close {
    width: 44px;
    height: 44px;
  }
}
.layoutpreview rect {
  stroke: none;
}
.layoutpreview .frame {
  stroke: #c9d8d5;
  stroke-width: 1;
}

/* The "Pridať šablónu" and "Prázdny dokument" cards share the grid of the other cards. */
.studio-shell .homeaddpaper,
.studio-shell .homeblankpaper {
  box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--teal) 50%, var(--line));
  background: var(--surface);
}
.studio-shell .hometemplate {
  align-content: start;
  align-items: stretch;
  text-align: left;
}
.studio-shell .hometemplate > small {
  margin-top: -8px;
  color: var(--muted);
  line-height: 1.4;
}
@media (max-width: 420px) {
  .studio-shell .homegrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Inserted data: field, condition and broken reference differ in shape and mark, not only colour. */
.studio-shell .paper .chip.condition,
.paper .chip.condition {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px 1px 6px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
}
.paper .chip.condition::before {
  display: none;
}

/* Conditional text remains editable without decorative side rules. */
.paper .conditionmarker,
.paper .conditionbranch {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.paper .conditionmarker {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  background: transparent;
  line-height: 1.4;
}
.paper .conditionmarker.is-end {
  margin-top: 0;
  margin-bottom: 12px;
  padding-top: 0;
  padding-bottom: 4px;
  background: transparent;
}
.studio-shell .paper .conditionmarker .chip.condition,
.paper .conditionmarker .chip.condition {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font:
    600 12px/1.5 Inter,
    system-ui,
    sans-serif;
}
.studio-shell .paper .conditionmarker.is-end .chip.condition,
.paper .conditionmarker.is-end .chip.condition {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.paper .conditionmarker.is-end .chip.condition::before {
  display: none;
}
.paper .conditionbranch {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}
.paper .doctextbox {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.paper .conditionhidden {
  margin: 8px 0;
  padding: 6px 10px;
  border-left: 0;
  color: var(--muted);
  font:
    12px/1.5 Inter,
    system-ui,
    sans-serif;
}

/* Empty states: what is missing and what to do next. */
.homeempty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 32px 0;
  max-width: 520px;
  color: var(--ink);
}
.homeempty strong {
  font-size: 16px;
  font-weight: 600;
}
.homeempty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.homeemptyactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.homeemptyactions button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}
.homeemptyactions .primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

/* Control icons share one size; select chevrons stay smaller. */
.studio-shell
  :is(.appbar, .formatbar, .edittools, #inspector, #insertPopover, .filemenu)
  :is(button:not(.selectcontrol), summary, label)
  > svg:not(:has(use[href='#i-chevron'])) {
  width: 16px;
  height: 16px;
  flex: none;
}
.studio-shell
  :is(.appbar, .formatbar, .edittools)
  :is(button, summary)
  > svg:has(use[href='#i-chevron']),
.studio-shell .selectcontrol > svg {
  width: 12px;
  height: 12px;
  flex: none;
}

/* Quiet editor chrome: document identity, grouped tools and a continuous canvas. */
.studio-shell .appbar.compactheader {
  gap: 12px;
  padding-inline: 24px;
}
.studio-shell .compactheader .wordmark {
  min-width: 124px;
}
.studio-shell .studio-breadcrumb {
  padding-left: 16px !important;
  color: var(--muted);
}
.studio-shell .studio-modes {
  padding: 0;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.studio-shell .studio-modes button {
  height: 40px;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 4px;
  color: var(--muted);
}
.studio-shell .studio-modes button:hover {
  background: var(--canvas);
  color: var(--ink);
}
.studio-shell .studio-modes button.studio-mode-active {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}
.studio-shell .studio-modes button::after {
  display: block;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 2px;
  background: var(--brand);
}

.studio-shell .studio-commandbar {
  min-height: 48px;
  padding-block: 8px;
}
.studio-shell .studio-insertions {
  border-left: 0;
  padding: 0;
  gap: 4px;
}
.studio-insertions button {
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  padding-inline: 12px;
}
.studio-insertions button:hover,
.studio-insertions button[aria-expanded='true'] {
  border-color: var(--teal);
  background: var(--soft);
  color: var(--brand);
}
.studio-shell .texttoolrow {
  background: var(--canvas);
  padding-block: 8px;
  gap: 12px;
}
.studio-shell .edittools .toolcluster + .toolcluster {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.studio-shell .edittools .selectcontrol {
  background: var(--surface);
  border-color: var(--line);
}
.studio-shell .edittools button:disabled,
.studio-shell .edittools .selectcontrol:disabled {
  opacity: 0.55;
}
.studio-shell .paperscroll {
  padding-top: 40px;
  padding-bottom: 64px;
}
.studio-outline {
  background: var(--canvas);
}
.studio-outline-heading,
.studio-shell .panelheader {
  border-bottom: 1px solid var(--line);
}
.studio-outline #outline {
  padding: 12px;
}
.studio-outline #outline button {
  min-height: 40px;
  margin-bottom: 4px;
  padding: 8px 12px;
  line-height: 1.5;
  border-radius: 6px;
}
.studio-outline #outline button:hover {
  background: var(--surface);
  color: var(--brand);
}
.studio-shell .paper .chip {
  border-radius: 6px;
  padding: 1px 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.studio-shell .paper .chip:not(.invalid):not(.condition) {
  background: var(--done);
  color: var(--brand);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
}
.studio-shell .paper .chip.invalid {
  padding: 0 1px;
  background: transparent;
  color: var(--finding-text);
  border-bottom: 1px solid #c8a16c;
  border-radius: 0;
}
.studio-shell .paper .chip.invalid:hover {
  background: #faf6ef;
}
.studio-shell .paper .chip.invalid::after {
  width: auto;
  margin-left: 3px;
  background: transparent;
  color: var(--finding-text);
  font-size: 11px;
  vertical-align: super;
}
.studio-shell .paper .chip.condition {
  border-radius: 6px;
  background: var(--canvas);
  border-color: var(--line);
  color: var(--brand);
}
.studio-shell :is(button, summary, a, select, input, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* Let tool groups wrap as units before they can collide on a tablet. */
@media (min-width: 601px) and (max-width: 1050px) {
  .studio-shell .appbar.compactheader {
    padding-inline: 16px;
    gap: 8px;
  }
  .studio-shell .studio-breadcrumb {
    display: none;
  }
  .studio-shell .compactheader .wordmark {
    min-width: 112px;
  }
  .studio-shell .compactheader .documentidentity {
    min-width: 64px;
  }
  .studio-shell .studio-modes button {
    padding-inline: 8px;
  }
  .studio-shell .studio-commandbar {
    padding-inline: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .studio-shell .studio-commandbar .workspaceMenus {
    flex: 1 1 auto;
  }
  .studio-shell .studio-insertions {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .studio-shell .texttoolrow {
    padding-inline: 16px;
    gap: 8px;
  }
  .studio-shell .paperscroll {
    padding-top: 24px;
  }
}

@media (max-width: 600px) {
  .studio-shell .appbar.compactheader {
    padding: 8px 12px;
    height: auto;
    min-height: 108px;
    grid-template-rows: 44px 44px;
    gap: 4px 8px;
  }
  .studio-shell .compactheader .wordmark {
    min-width: 0;
  }
  .studio-shell .studio-modes {
    padding: 0;
    gap: 4px;
    border: 0;
    background: transparent;
  }
  .studio-shell .studio-modes button,
  .studio-shell #export,
  .studio-shell .help-button {
    min-height: 44px;
    height: 44px;
  }
  .studio-shell .studio-commandbar {
    padding: 4px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .studio-shell .studio-commandbar :is(button, summary) {
    min-height: 44px;
  }
  .studio-shell .studio-insertions {
    gap: 4px;
    margin-left: auto;
  }
  .studio-shell .studio-insertions button {
    padding-inline: 8px;
    font-size: 12px;
  }
  .studio-shell .texttoolrow {
    padding: 4px 12px;
    gap: 8px;
  }
  .studio-shell .paperscroll {
    padding: 16px 12px 32px;
  }
  .studio-shell .inspector {
    max-height: calc(100dvh - 16px);
    border-radius: 8px 8px 0 0;
  }
  .studio-shell .panelheader {
    min-height: 56px;
    padding: 8px 16px;
  }
  .studio-shell dialog#modal {
    max-height: calc(100dvh - 24px);
    scroll-padding-block: 16px;
  }
  .studio-shell dialog#modal .modalactions {
    position: sticky;
    bottom: -16px;
    background: var(--surface);
    padding-block: 12px;
    margin-bottom: -16px;
  }
}

@media (max-width: 600px) {
  .studio-shell .texttoolrow {
    flex-wrap: wrap;
  }
  .studio-shell .texttoolrow #mobileFormatting {
    display: inline-flex;
    min-height: 44px;
    margin-left: auto;
    order: 2;
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .studio-shell .texttoolrow .historycluster {
    order: 1;
  }
  .studio-shell
    .formatbar:not(.formatting-expanded)
    .texttoolrow
    :is(.emphasiscluster, .paragraphcluster, .colorcluster, .fontcluster, #paragraphSettings) {
    display: none;
  }
  .studio-shell
    .formatting-expanded
    .texttoolrow
    :is(.emphasiscluster, .paragraphcluster, .colorcluster, .fontcluster, #paragraphSettings) {
    order: 3;
  }
  .studio-shell .paper .chip[role='button'] {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    min-height: 44px;
    padding: 4px 6px;
  }
}

/* Comparison with eGRANT generator output. */
.comparison-page {
  background: var(--canvas);
}
.comparison-layout {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.comparison-layout h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.comparisonlead {
  max-width: 720px;
  margin: 0 0 8px;
  color: var(--ink);
}
.comparisonnote {
  max-width: 720px;
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--muted);
}
.comparisoncase {
  margin-top: 16px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.comparisoncase h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.comparisonscore {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft);
}
.comparisonscore.is-warn {
  background: var(--finding-bg);
  color: var(--finding-text);
}
.comparisonexplained {
  margin-top: 12px;
}
.comparisonexplained summary {
  cursor: pointer;
  font-weight: 600;
}
.comparisontable {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}
.comparisontable th,
.comparisontable td {
  padding: 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.comparisontable th {
  color: var(--muted);
  font-weight: 600;
}
@media (max-width: 600px) {
  .comparison-layout {
    padding: 20px 16px 48px;
  }
  .comparisoncase {
    padding: 16px;
  }
  .comparisontable,
  .comparisontable tbody,
  .comparisontable tr,
  .comparisontable td {
    display: block;
  }
  .comparisontable thead {
    display: none;
  }
  .comparisontable td {
    border-top: 0;
    padding: 2px 0;
  }
  .comparisontable td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
    font-weight: 600;
  }
  .comparisontable tr {
    padding: 8px 0;
    border-top: 1px solid var(--line);
  }
}

/* Kontrola: a quiet report with dividers instead of nested cards. */
:is(.studio-shell, .practice-page) #checkPane .checkoverview.checksummary,
:is(.studio-shell, .practice-page) #checkPane .checksummary.is-ready,
:is(.studio-shell, .practice-page) #checkPane .checksummary.is-blocked {
  padding: 4px 0 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
:is(.studio-shell, .practice-page) #checkPane .checkcounts {
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
}
:is(.studio-shell, .practice-page) #checkPane .checkcounts li {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
}
:is(.studio-shell, .practice-page) #checkPane .checkcounts b {
  display: inline;
  font-size: 13px;
  font-weight: 600;
}
:is(.studio-shell, .practice-page) #checkPane .checksummary .fixsafe {
  width: auto;
  margin-top: 16px;
  padding-inline: 14px;
}
:is(.studio-shell, .practice-page) #checkPane .issuegroup {
  margin-top: 24px;
}
:is(.studio-shell, .practice-page) #checkPane .issuegroup > h2 {
  font-size: 14px;
}
:is(.studio-shell, .practice-page) #checkPane .finding {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
:is(.studio-shell, .practice-page) #checkPane .finding[data-finding]:hover,
:is(.studio-shell, .practice-page) #checkPane .finding.is-current {
  background: transparent;
  box-shadow: none;
}
:is(.studio-shell, .practice-page) #checkPane .finding.is-current h3 {
  color: var(--brand);
}
:is(.studio-shell, .practice-page) #checkPane .findingbadge {
  padding: 0;
  border-radius: 0;
  background: transparent;
}
:is(.studio-shell, .practice-page) #checkPane .finding .findingproposal {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

/* Compact quick actions: the document library remains the main destination. */
.homeguard {
  margin-bottom: 32px;
}
.guardintro {
  gap: 10px;
  margin-bottom: 14px;
}
.guardintro .guardlead {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}
.guardintro .mascot {
  width: 52px;
  height: 52px;
  max-height: 52px;
}
.guardcards {
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.guardcard,
.guardcard:first-child {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  align-content: start;
  column-gap: 12px;
  row-gap: 5px;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.guardcard + .guardcard {
  border-left: 1px solid var(--line);
}
.guardcard .guardillustration {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 60px;
  height: 60px;
  margin: 0;
  object-fit: contain;
}
.guardcard h2,
.guardcard p,
.guardcard > .guardactions {
  grid-column: 2;
}
.guardcard h2 {
  font-size: 14px;
  line-height: 1.4;
}
.guardcard p {
  font-size: 12px;
  line-height: 1.55;
}
.guardcard > .guardactions {
  align-self: end;
  min-height: 0;
  margin-top: 10px;
}
@media (max-width: 720px) {
  .guardintro .guardlead {
    font-size: 14px;
  }
  .guardcards {
    gap: 0;
  }
  .guardcard,
  .guardcard:first-child {
    padding: 16px 0;
  }
  .guardcard + .guardcard {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .guardcard > .guardactions {
    margin-top: 8px;
  }
}
/* Buttons use the full card width so every card keeps its actions on one bottom line. */
.guardcard > .guardactions {
  grid-column: 1 / -1;
  flex-wrap: nowrap;
  min-height: 0;
}
.guardcard .guardactions button {
  white-space: nowrap;
}
.guardproof {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 12px 0 0;
  font-size: 13px;
}
.guardproof a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.guardproof a:hover {
  text-decoration: underline;
}
/* Three columns leave too little room for two buttons below this width: one card per row. */
@media (max-width: 900px) {
  .guardcards {
    grid-template-columns: minmax(0, 1fr);
  }
  .guardcard + .guardcard {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 420px) {
  .guardcard > .guardactions {
    flex-wrap: wrap;
  }
}

/* Column names in the editor wrap onto more lines instead of being cut off; a word too long
   for a narrow column is hyphenated (the page is in Slovak). */
.studio-shell textarea.inline-table-heading {
  resize: none;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
}

/* Editor: compact, consistent controls around the document. */
.studio-shell .appbar.compactheader {
  column-gap: 10px;
}
.studio-shell .compactheader .documentidentity {
  min-width: 0;
}
.studio-shell .studio-modes button {
  padding-inline: 12px;
  font-size: 13px;
}
.studio-shell #export {
  min-height: 38px;
  padding-inline: 15px;
}

/* The table's contextual tools sit close to the table, with readable targets. */
.studio-shell .tableactions {
  align-items: center;
  gap: 3px;
  padding: 4px 0 8px;
}
.studio-shell .tableactions button {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.studio-shell .tableactions button:hover:not(:disabled) {
  background: var(--canvas);
  color: var(--ink);
}
.studio-shell .tableactions button[aria-expanded='true'] {
  background: var(--soft);
  color: var(--brand);
}
.studio-shell .tableactions .tableedit {
  color: var(--brand);
  font-weight: 600;
}

/* Dynamic content is quiet in the document; errors remain clearly marked. */
.studio-shell .paper .chip:not(.invalid):not(.condition) {
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: #edf4f2;
  color: #315f5b;
  font-weight: 500;
}
.studio-shell .paper .chip:not(.invalid):not(.condition):hover {
  background: #deeeea;
  color: #124e4c;
}
.studio-shell .paper .chip.computed:not(.invalid):not(.condition) {
  padding: 0 1px;
  background: transparent;
  color: #315f5b;
  text-decoration: underline;
  text-decoration-color: #a9c6bf;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.studio-shell .paper .chip.computed:not(.invalid):not(.condition):hover {
  background: transparent;
  color: #124e4c;
  text-decoration-color: currentColor;
}

/* Findings are a readable report, not a stack of cards. */
.studio-shell #checkPane .issuegroup > h2 {
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.studio-shell #checkPane .finding h3 {
  font-size: 14px;
  line-height: 1.45;
}
.studio-shell #checkPane .finding p {
  margin-top: 6px;
  line-height: 1.6;
}
.studio-shell #checkPane .findingactions {
  gap: 10px;
  margin-top: 12px;
}

/* A friendly welcome, a smaller assistant beside working content. */
.guardintro .mascot {
  width: 64px;
  height: 64px;
  max-height: 64px;
}
.studio-shell #checkPane .checkoverview > .summaryhead {
  grid-template-columns: 44px minmax(0, 1fr);
}
.studio-shell #checkPane .summaryhead .mascot {
  width: 44px;
  height: 44px;
  max-height: 44px;
}
@media (max-width: 600px) {
  .studio-shell .tableactions button {
    min-height: 44px;
    padding-inline: 10px;
  }
  .studio-shell .studio-modes button,
  .studio-shell #export {
    min-height: 44px;
  }
}

/* Loading indicators only accompany operations that are actually in progress. */
:is(.previewloading, #newDocumentStatus.is-loading, button[aria-busy='true'])::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tessera-loading-spin 0.8s linear infinite;
}
@keyframes tessera-loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(.previewloading, #newDocumentStatus.is-loading, button[aria-busy='true'])::before {
    animation: none;
  }
}

/* Home screen placeholder (index.html): each shape keeps the real element's box and hides its
   content; inline text spans become one bar per line. */
.homeskeleton .skeleton {
  border-color: transparent !important;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 7%, transparent) !important;
  box-shadow: none !important;
  color: transparent !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: tessera-skeleton-pulse 1.4s ease-in-out infinite;
}
.homeskeleton .skeleton > * {
  visibility: hidden;
}
.homeskeleton .homepaper.skeleton {
  border-color: var(--line) !important;
  border-radius: 0;
  background: var(--surface) !important;
}
@keyframes tessera-skeleton-pulse {
  50% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  .homeskeleton .skeleton {
    animation: none;
  }
}
