/* Shared control geometry. Route styles own solid colour, width and placement;
   this layer owns the target, typography and unshadowed face. Important declarations in a named layer
   also apply when a route stylesheet is loaded after the initial document. */
@property --control-expected-size {
  syntax: "<length> | auto";
  inherits: false;
  initial-value: 0px;
}
@property --control-expected-font-size {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@layer controlGeometry {
  :root {
    --control-action-height: 2rem;
    --control-field-height: max(44px, 2.5rem);
    --control-navigation-height: max(36px, 2.1rem);
    --control-target-min: 0px;
    --control-size: var(--control-action-height);
    --action-height: var(--control-action-height);
    --settings-control-height: var(--control-field-height);
    --action-font: system-ui, "Malgun Gothic", sans-serif;
    --action-size: .8rem;
  }

  /* Classification is inspectable by the route audit, including controls that
     deliberately remain a reading heading, a choice or a file drop target. */
  :is(button, summary, input, select, textarea) {
    --control-role: action;
    --control-expected-size: var(--control-action-height);
    --control-size: var(--control-action-height);
    --control-font-size: var(--action-size, .8rem);
  }
  :is(input, select) {
    --control-role: input;
    --control-expected-size: var(--control-field-height);
    --control-size: var(--control-field-height);
    --control-font-size: .94rem;
  }
  summary {
    --control-role: heading;
    --control-expected-size: auto;
  }
  /* Plain navigation links are measured without changing their reading layout.
     The boxed navigation/action families below opt into a fixed target. */
  :is(nav a, .rail-foot a, .site-footer a, .book-inline-link) {
    --control-role: heading;
    --control-expected-size: auto;
  }
  textarea {
    --control-role: multiline;
    --control-expected-size: auto;
  }
  :is(input[type="checkbox"], input[type="radio"]) {
    --control-role: choice;
    --control-expected-size: auto;
  }
  input[type="hidden"] {
    --control-role: hidden;
    --control-expected-size: 0px;
  }
  :is(input[type="range"], input[type="color"], select[multiple], select[size]) {
    --control-role: specialized;
    --control-expected-size: auto;
  }
  :is(input[type="file"], .file-drop-action, .file-dropzone) {
    --control-role: drop;
    --control-expected-size: auto;
  }

  /* Short actions, native filters and action-like disclosure summaries share
     one border-box height. Action labels keep the same font inside and outside
     forms; the larger field target does not enlarge their text. Long content
     headings are listed separately below. */
  html[lang="ko"] :is(
    button:not(.file-drop-action, .file-dropzone, .lookup-title-button, .ruling-card-title, .book-reader-open,
      .topic-card-link, .topic-directory-node, .ms-topic-link,
      .page-copy-editable, .library-search-title, .notes-list-title,
      .pc-case-summary, .nav-group-toggle),
    a.button, a.action, a.library-item-button, a.library-original-link,
    a.page-compose-link, a.library-cover-link, a.library-small-link,
    a.workspace-text-link, a.library-search-calculator, a.library-admin-action,
    a.library-session-button, a.session-label, a.topbar-login,
    a.library-install, a.screen-mode-action,
    a.notes-button, a.tax-content-button, a.notebook-tax-shortcut,
    a.share-login, a.share-source, .public-original-heading nav a,
    .library-install-page .actions > a, .library-install-page .device-nav > a,
    .library-print-page nav > a,
    .navigation-affordance:not(.library-search-title),
    .profile-actions > a, .research-entry-links > a,
    .case-index-source, .case-index-more, .case-index-management a,
    .research-related-links > a, .research-classification > a,
    .book-case-links > a, .book-body-source > a,
    .book-case-source .book-inline-link,
    .library-reader-actions .book-inline-link,
    .library-owner-actions .book-inline-link,
    .comics-tools > a, .comics-source > a, .news-desk-source,
    .agency-source, .agency-series-original, .agency-detail .workspace-actions > a,
    .columns-archive-link, .editorial-record-source, .editorial-record-back,
    .lookup-law-shortcut, .lookup-law-whole, .lookup-source-line a,
    .lookup-original-link, .lookup-original-body > .lookup-link,
    .lookup-official > .lookup-link, .library-page-management > a,
    .library-book-actions > a, .library-book-related > a,
    .topic-reference-groups a, .ruling-placement-links > a,
    .md-actions > a, .tw-rate-links a, .tw-edition-link,
    .case-index-step, .urban-statute-source, .ud-pager > a,
    .ud-board-heading :is(a, button), .ud-board-filters a,
    a.ud-material-source, .complex-drawing-link,
    .urban-ordinance-links a,
    .news-desk-paging > a, .columns-pagination > a,
    .editorial-record-pagination > a, .agency-pagination > a, .lookup-paging > a,
    .library-item-visibility, .library-result-sort, .library-result-filter,
    .case-topic-commentary-filter,
    summary.library-item-button, summary.library-filter-toggle,
    .topic-list-management > summary,
    .topic-manuscript .topic-manuscript-link,
    .ruling-connected-manuscript > summary,
    .ruling-book-connection > summary,
    .ruling-bulk-entry > summary,
    .notebook-visibility > summary,
    .columns-management > summary,
    .columns-filter-options > summary,
    .news-desk-editor > summary,
    .room-tools > summary,
    .shelf-topic-tools > summary,
    .lookup-date-fold > summary,
    .pc-outline-actions summary,
    .case-display-settings > summary,
    .ruling-downloads > summary,
    .tw-entry-tools .tw-lookup > summary,
    .tw-optional > summary,
    .tw-history > summary,
    .library-page-visibility > summary,
    .pc-outline-tools select,
    .library-result-tools select,
    .topic-owner-tools select,
    .library-owner-actions select,
    .library-member-actions select
  ) {
    --control-role: action;
    --control-expected-size: var(--control-size);
    --control-expected-font-size: var(--action-size);
    box-sizing: border-box !important;
    height: auto !important;
    block-size: auto !important;
    min-height: var(--control-size) !important;
    min-block-size: var(--control-size) !important;
    max-height: none !important;
    max-block-size: none !important;
    min-inline-size: var(--control-target-min) !important;
    padding-block: 0 !important;
    font-family: var(--action-font) !important;
    font-size: var(--action-size) !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
    vertical-align: middle;
  }
  html[lang="ko"] :is(
    .library-item-visibility, .library-result-sort, .library-result-filter,
    .case-topic-commentary-filter, .pc-outline-tools select,
    .library-result-tools select, .topic-owner-tools select,
    .library-owner-actions select, .library-member-actions select,
    .topic-list-management > summary,
    .topic-manuscript .topic-manuscript-link,
    .ruling-connected-manuscript > summary,
    .ruling-book-connection > summary,
    .ruling-bulk-entry > summary,
    .notebook-visibility > summary,
    .columns-management > summary,
    .columns-filter-options > summary,
    .news-desk-editor > summary,
    .room-tools > summary,
    .shelf-topic-tools > summary,
    .lookup-date-fold > summary,
    .pc-outline-actions summary,
    .case-display-settings > summary,
    .ruling-downloads > summary,
    .tw-entry-tools .tw-lookup > summary,
    .tw-optional > summary,
    .tw-history > summary,
    summary.library-item-button, summary.library-filter-toggle
  ) {
    --control-size: var(--control-action-height);
    --control-font-size: var(--action-size, .8rem);
  }
  html[lang="ko"] .lookup-date-fold {
    flex: 0 0 auto;
    min-inline-size: max-content;
  }
  html[lang="ko"] .lookup-date-fold > summary {
    white-space: nowrap !important;
  }

  /* Search, entry and edit fields use the same larger height with their action.
     Native choices, colour tools, file pickers and the date hit overlay keep
     their own semantics and are not stretched into ordinary text fields. */
  html[lang="ko"] :is(
    input:not([type="checkbox"], [type="radio"], [type="range"],
      [type="color"], [type="file"], [type="hidden"]),
    select:not([multiple], [size], .tw-amount-unit)
  ):not(.tw-calendar > input) {
    --control-expected-font-size: var(--control-font-size, .94rem);
    box-sizing: border-box !important;
    height: var(--control-size) !important;
    block-size: var(--control-size) !important;
    min-height: var(--control-size) !important;
    min-block-size: var(--control-size) !important;
    max-height: none !important;
    max-block-size: none !important;
    padding-block: 0 !important;
    line-height: 1.2 !important;
    font-family: var(--action-font) !important;
    font-size: var(--control-font-size, .94rem) !important;
  }
  html[lang="ko"] :is(
    form,
    .library-search-box, .library-search-form, .library-front-input,
    .library-search-controls, .columns-search, .agency-search,
    .notes-search, .book-controls, .case-index-filters,
    .case-topics-filters, .lookup-search-row, .lookup-date-filters,
    .home-district-search, .home-district-filters,
    .ud-search, .ud-controls, .ud-editor, .ud-board-form,
    .private-share-dialog, .ruling-batch-dialog, .ruling-bulk-dialog,
    .library-page-tools, .library-publicity-form,
    .ruling-compose-form, .ruling-lookup-form, .ruling-field-assignment,
    .tax-content-form, .tax-news-form, .settings-key-form, .ms-filters,
    .library-collections-tools,
    .settings-provider-tools, .notes-editor, .member-form, .room-form,
    .member-secret-field, .topic-card-editor, .case-topics-editor,
    .ep-form, .ep-quick-form, .pc-source-address, .pc-form-actions,
    .tw, .document-find-panel, .document-tools, .library-install-page
  ) :is(button, a.button, a.action, .library-item-button, select,
    summary.library-filter-toggle, .ruling-book-connection > summary) {
    --control-size: var(--control-field-height);
    --control-font-size: .88rem;
  }
  html[lang="ko"] .library-install-page :is(.actions > a, .device-nav > a) {
    --control-size: var(--control-field-height);
  }
  html[lang="ko"] .case-index-step {
    --control-size: var(--control-field-height);
  }
  html[lang="ko"] :is(
    .topbar, .library-result-tools, .library-item-actions, .library-owner-actions,
    .library-member-actions, .topic-list-utilities, .topic-owner-tools,
    .ruling-selection-toolbar, .ruling-selection-options,
    .pc-outline-tools, .library-reader-actions, .topic-subcategory-actions,
    .lookup-result-tools, .lookup-result-scope, .case-index-result-facets,
    .urban-decision-filters, .topic-card-view-tools, .ep-tools,
    .comics-reader-tools, .visit-range, .urban-statute-selection
  ) :is(button, select, summary.library-item-button, .library-item-button,
    .library-original-link, input[type="search"], input[type="date"]),
  html[lang="ko"] .topic-subcategory-actions > input[type="text"],
  html[lang="ko"] :is(select.library-result-filter, select.library-result-sort) {
    --control-role: action;
    --control-size: var(--control-action-height);
    --control-expected-size: var(--control-action-height);
    --control-font-size: var(--action-size, .8rem);
  }

  /* The indentation editor stays a field form when opened inside the compact
     owner toolbar. Its submit action shares the number inputs' field height. */
  html[lang="ko"] .statute-indent-tools .statute-indent-form > .library-item-button {
    --control-size: var(--control-field-height);
    --control-expected-size: var(--control-field-height);
  }

  /* The lock outline is inset: it cannot add a second vertical margin/border
     around an already-sized button, including nested menus and mobile rows. */
  html[lang="ko"] :is(.library-owner-actions, .library-member-actions,
    .topic-list-utilities) {
    box-sizing: border-box !important;
    min-height: 0 !important;
    min-block-size: 0 !important;
    padding-block: 0 !important;
    border-block-width: 0 !important;
    align-items: center;
    column-gap: .36rem;
    row-gap: .36rem;
  }
  html[lang="ko"] .library-member-actions {
    border: 0 !important;
    box-shadow: inset 0 0 0 1px #c4d1c6;
  }
  html[lang="ko"] .ms-filters {
    align-items: center !important;
  }
  html[lang="ko"] .ms-layout-toggle {
    align-items: center !important;
    padding-block: 0 !important;
    border: 0 !important;
    box-shadow: inset 0 0 0 1px var(--ms-line, #c4d1c6);
  }
  html[lang="ko"] :is(.library-owner-lock, .library-private-mark) {
    flex-shrink: 0;
  }
  /* The fallback visibility select must also fit the longer 비공개 label and
     its arrow gutter. Wrap the complete select, instead of shrinking its text. */
  html[lang="ko"] .main-content select.library-item-visibility {
    flex-shrink: 0;
    min-inline-size: max(44px, calc(3em + 2.31rem + 2px)) !important;
  }

  /* Navigation rows are one role across tax, statutes, notes and books. */
  html[lang="ko"] :is(
    .library-selection-box > :is(a, button),
    .archive-switch > :is(a, button), .archive-view-switch > a,
    .archive-subtabs > a, .redevelopment-sections > a,
    .library-context-tabs > a, .tax-library-tabs > :is(a, button),
    .about-switcher > a, .profile-tabs > a,
    .book-main-tabs > a, .book-part-tabs > a, .book-selector > a,
    .case-index-tabs > a, .case-index-editions > a,
    .agency-tabs > a, .news-desk-tabs > a, .columns-publications > button,
    .institution-source-tabs > a, .news-area-tabs > a,
    .columns-view-options > a,
    .news-desk-category-tabs > a, .book-progress-filters a,
    .topic-directory-choices > a, .property-topic-all,
    .notebook-rate-primary a,
    .columns-filter-tabs > button, .pc-category-option, .case-topics-tabs > button,
    .ud-options > a, .ud-flow > a, .ud-compare-types > a,
    .member-panel .ms-tabs > button, .rail-owner-view button
  ) {
    --control-role: navigation !important;
    --control-size: var(--control-navigation-height);
    --control-expected-size: var(--control-navigation-height);
    --control-expected-font-size: .86rem;
    --control-font-size: .86rem;
    box-sizing: border-box !important;
    height: auto !important;
    block-size: auto !important;
    min-height: var(--control-size) !important;
    min-block-size: var(--control-size) !important;
    max-height: none !important;
    max-block-size: none !important;
    padding-block: .15rem !important;
    line-height: 1.25 !important;
    font-family: var(--action-font) !important;
    font-size: .86rem !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }
  /* Short navigation labels move as a whole when the content column narrows.
     A forced two-column grid must not turn one label into a taller control. */
  html[lang="ko"] :is(.columns-filter-tabs, .archive-primary-tabs,
    .tax-library-tabs, .ud-flow) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  html[lang="ko"] :is(.columns-filter-tabs, .archive-primary-tabs,
    .tax-library-tabs, .ud-flow) > :is(a, button) {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    align-self: center;
    white-space: nowrap !important;
  }
  html[lang="ko"] .case-topics-tabs {
    height: auto;
    min-height: var(--control-navigation-height);
  }

  html[lang="ko"] :is(.ruling-favorite-star, .member-star,
    .library-page-refresh-button, .pc-disclosure-toggle, .menu-toggle) {
    --control-role: icon !important;
    --control-expected-size: var(--control-size);
    --control-expected-font-size: 1rem;
    --control-font-size: 1rem !important;
    box-sizing: border-box !important;
    inline-size: var(--control-size) !important;
    min-inline-size: var(--control-size) !important;
    padding: 0 !important;
    font-size: 1rem !important;
  }

  html[lang="ko"] :is(.lookup-title-button, .ruling-card-title, .book-reader-open, .topic-card-link,
    .topic-directory-node, .ms-topic-link, .page-copy-editable,
    .library-search-title, .notes-list-title, .pc-case-summary,
    .nav-group-toggle, .rail .site-nav a,
    .library-reading-list a, .property-topic-card-grid a,
    .research-citation-link, .research-book-topic .research-link,
    .research-book-related > a, .book-intro-part-content > a,
    .workspace-card-title, .library-editions > a,
    .reference-group .workspace-record > h3 > a:first-child,
    .member-panel .ms-saved-hits a, .pc-project-row .pc-list-link,
    .tw-archive a, .tw-reform-table > a, .ud-saved-link, .urban-ordinance-choice,
    .ud-reading a, .urban-statute-reference, .urban-statute-outline-row a,
    .profile-guide-group li > a) {
    --control-role: heading !important;
    --control-expected-size: auto !important;
  }
  /* Full statutory names are content labels, not abbreviated action text.
     Preserve their natural line breaks and the common minimum touch target. */
  html[lang="ko"] .forms-law-tabs > .forms-law-tab {
    --control-role: heading !important;
    --control-expected-size: auto !important;
  }
  /* Connected locations and cited source lists contain full topic paths or
     document titles. Keep their readable lines and touch target instead of
     treating them as short toolbar commands. */
  html[lang="ko"] .ruling-placement-links > a.library-item-button,
  html[lang="ko"] .case-topic-reference > a.library-original-link {
    --control-role: heading !important;
    --control-expected-size: auto !important;
    padding-block: .3rem !important;
    line-height: 1.45 !important;
  }
  html[lang="ko"] .member-panel .ms-ruling-entry > summary {
    --control-role: heading !important;
    --control-expected-size: auto !important;
    padding-block: .3rem !important;
    line-height: 1.45 !important;
  }
  html[lang="ko"] .member-panel .ms-topic-document .ms-ruling-entry > summary {
    --control-font-size: 1.02rem !important;
    --control-expected-font-size: 1.02rem !important;
    font-size: 1.02rem !important;
  }
  /* A category option is a complete path, including every parent heading. */
  html[lang="ko"] .topic-category-choices > button.library-item-button {
    --control-role: choice !important;
    --control-expected-size: auto !important;
    min-block-size: max(44px, var(--control-size)) !important;
    padding-block: .3rem !important;
    line-height: 1.45 !important;
  }
  /* A statute choice retains its complete article title. Both the selected
     title and the open list may wrap while keeping the common minimum target. */
  html[lang="ko"] .urban-statute-tools .urban-article-picker :is(.urban-article-picker-toggle, .urban-article-choice) {
    --control-role: multiline !important;
    --control-expected-size: auto !important;
    padding-block: .3rem !important;
    line-height: 1.45 !important;
  }
  /* Article outline controls carry complete heading text. Let longer titles
     wrap on every device while preserving a readable font and touch target. */
  html[lang="ko"] .pc-outline-picker :is(.pc-outline-picker-trigger,.pc-outline-choice) {
    --control-role: multiline !important;
    --control-expected-size: auto !important;
    --control-expected-font-size: .94rem;
    min-block-size: max(44px, var(--control-size)) !important;
    padding-block: .35rem !important;
    font-size: .94rem !important;
    line-height: 1.45 !important;
    white-space: normal !important;
  }
  html[lang="ko"] :is(.tw-amount-unit, .tw-calendar > input,
    .ud-project-source-link, .ud-stage-source-link, svg a, a.notes-state, a.library-metadata-tag) {
    --control-role: specialized !important;
    --control-expected-size: auto !important;
  }

  @media (max-width: 700px), (pointer: coarse) {
    :root {
      --control-action-height: max(44px, 2rem);
      --control-navigation-height: max(44px, 2.1rem);
      --control-target-min: 44px;
    }
    html[lang="ko"] :is(summary, .lookup-title-button, .ruling-card-title, .book-reader-open, .topic-card-link,
      .topic-directory-node, .ms-topic-link, .page-copy-editable,
      .library-search-title, .notes-list-title, .pc-case-summary,
      .nav-group-toggle) {
      min-block-size: 44px !important;
    }
    html[lang="ko"] :is(
      input:not([type="checkbox"], [type="radio"], [type="range"],
        [type="color"], [type="file"], [type="hidden"]),
      select:not([multiple], [size], .tw-amount-unit, .library-result-filter, .library-result-sort)
    ):not(.tw-calendar > input) {
      --control-expected-font-size: max(16px, var(--control-font-size, .94rem));
      font-size: max(16px, var(--control-font-size, .94rem)) !important;
    }
  }
  html[lang="ko"] .main-content select:is(.library-result-filter,.library-result-sort) {
    --control-expected-font-size:var(--action-size);
    font-size:var(--action-size) !important;
  }
}
