:root {
  --md-primary: #315ea8;
  --md-on-primary: #ffffff;
  --md-primary-container: #d9e5ff;
  --md-on-primary-container: #0f2f63;
  --md-secondary: #596579;
  --md-surface: #f8f9fc;
  --md-surface-container: #eef1f6;
  --md-surface-container-high: #e6eaf1;
  --md-surface-bright: #ffffff;
  --md-outline: #74777f;
  --md-outline-variant: #c5c7cf;
  --md-on-surface: #1a1c1e;
  --md-on-surface-variant: #44474e;
  --md-info: var(--md-primary);
  --md-info-container: var(--md-primary-container);
  --md-on-info-container: var(--md-on-primary-container);
  --md-success: #2f6a45;
  --md-success-container: #c4efd1;
  --md-on-success-container: #173a25;
  --md-warning: #795900;
  --md-warning-container: #ffdea1;
  --md-on-warning-container: #3b2f00;
  --md-error: #ba1a1a;
  --md-error-container: #ffdad6;
  --md-on-error-container: #410002;
  --button-neutral-bg: var(--md-surface-container-high);
  --button-neutral-fg: var(--md-on-surface);
  --button-neutral-outline: var(--md-outline);
  --button-neutral-hover-bg: var(--md-outline-variant);
  --md-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 4px 12px rgba(16, 24, 40, .06);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --side-width: 236px;
  --top-height: 64px;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--md-on-surface);
  background: var(--md-surface);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-width: 1180px;
  background: var(--md-surface);
  color: var(--md-on-surface);
}

body {
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .01em;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

p {
  color: var(--md-on-surface-variant);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App shell */

.app-shell {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f2f4f9;
  border-right: 1px solid var(--md-outline-variant);
}

.brand {
  height: var(--top-height);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--md-outline-variant);
}

.brand strong {
  display: block;
  font-size: 15px;
}

.nav-sections {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  margin: 2px 0;
  border-radius: 20px;
  color: #34373c;
  font-weight: 500;
}

.nav-item:hover {
  background: #e8ebf2;
}

.nav-item.is-active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 700;
}

.nav-group {
  margin: 4px 0 6px;
}

.nav-group-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #34373c;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.nav-group-toggle:hover {
  background: #e8ebf2;
}

.nav-group.is-active > .nav-group-toggle {
  color: var(--md-primary);
}

.nav-group-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
  transition: transform .16s ease;
}

.nav-group-toggle[aria-expanded="false"] .nav-group-chevron {
  transform: rotate(-45deg) translate(-1px, -1px);
}

.nav-group-children {
  margin-left: 18px;
  padding-left: 8px;
  border-left: 1px solid var(--md-outline-variant);
}

.nav-group-children[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-group-chevron {
    transition: none;
  }
}

.nav-item--child {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: 13px;
}

.account-area {
  position: relative;
}

.account-trigger {
  border: 1px solid var(--md-outline-variant);
  background: white;
  color: var(--md-on-surface);
  text-align: left;
  cursor: pointer;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: var(--md-outline);
  background: var(--md-surface-container);
}

.top-bar-account {
  flex: 0 0 auto;
}

.top-bar-account-trigger {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 7px;
  border-radius: 10px;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #d8dde8;
  color: var(--md-on-surface);
}

.account-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.account-user-name {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.account-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  background: white;
  box-shadow: var(--md-shadow);
}

.account-menu a,
.account-menu button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--md-on-surface);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.account-menu a:hover,
.account-menu button:hover {
  background: var(--md-surface-container);
}

.app-main {
  min-width: 0;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 16px 0 24px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--md-outline-variant);
  backdrop-filter: blur(8px);
}

.top-bar-title {
  font-weight: 700;
}

.page-content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.page-content--fixed-list {
  height: calc(100vh - var(--top-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 6px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-heading p {
  margin-bottom: 0;
}

.page-heading-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--md-primary);
  font-size: 12px;
  font-weight: 700;
}

.surface {
  background: var(--md-surface-bright);
  border: 1px solid #d8dbe2;
  border-radius: var(--radius-m);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.surface + .surface {
  margin-top: 16px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 10px;
}

.section-header p {
  margin-bottom: 0;
  font-size: 13px;
}

/* Buttons and fields */

.button,
.text-button,
.icon-button,
.tool-button {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.button.primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.button.primary:hover {
  background: #264f94;
}

.button.tonal {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.button.tonal:hover {
  background: #cbdcff;
}

.button.neutral {
  background: var(--button-neutral-bg);
  color: var(--button-neutral-fg);
}

.button.neutral:hover {
  background: var(--button-neutral-hover-bg);
}

.button.neutral-outlined {
  border: 1px solid var(--button-neutral-outline);
  background: transparent;
  color: var(--button-neutral-fg);
}

.button.neutral-outlined:hover {
  background: var(--md-surface-container);
}

.button.destructive {
  background: var(--md-error);
  color: white;
}

.button.destructive:hover {
  background: #9d1212;
}

.button.destructive-tonal {
  background: #ffdad6;
  color: #93000a;
}

.button.destructive-tonal:hover {
  background: #ffc8c2;
}

.button.wide {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  font-size: 12px;
}

.large-button {
  min-height: 48px;
  border-radius: 24px;
  padding: 0 28px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  background: transparent;
  color: var(--md-primary);
  font-weight: 700;
}

.text-button.neutral {
  color: var(--md-on-surface-variant);
}

.text-button.neutral:hover {
  background: var(--md-surface-container);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
}

.icon-button:hover {
  background: var(--md-surface-container);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
}

.field em {
  color: var(--md-on-surface-variant);
  font-style: normal;
  font-weight: 400;
}

.field-label-inline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 18px;
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.field-label-inline > span {
  font-weight: 700;
}

.field-label-inline > em {
  color: var(--md-on-surface-variant);
  font-style: normal;
  font-weight: 400;
  text-align: left;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-s);
  background: white;
  color: var(--md-on-surface);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px rgba(49, 94, 168, .14);
}

.field.grow {
  flex: 1 1 440px;
}

.field.compact {
  flex: 0 0 190px;
}

.field-stack {
  display: grid;
  gap: 16px;
}

/* Login */

.login-page {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 20% 15%, rgba(49, 94, 168, .12), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(49, 94, 168, .08), transparent 30%),
    #f4f6fa;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  background: white;
  border: 1px solid #dfe2e8;
  border-radius: 22px;
  box-shadow: var(--md-shadow);
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
}

.login-submit {
  margin-top: 16px;
}

/* A1 list */

.filter-surface {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.table-surface {
  overflow: visible;
}

.table-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid #e1e4e9;
}

.article-list-table .table-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  justify-content: normal;
}

.table-toolbar h2,
.table-toolbar p {
  margin-bottom: 0;
}

.table-toolbar p {
  margin-top: 3px;
  font-size: 12px;
}

.sort-note {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.article-list-table .sort-note {
  justify-self: end;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.page-content--fixed-list .article-list-table {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.article-list-table .data-table-wrap {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-gutter: stable;
}

.article-list-table .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  min-height: 52px;
  padding: 11px 14px;
  border-bottom: 1px solid #e4e6eb;
  vertical-align: middle;
}

.data-table th {
  background: #f7f8fb;
  color: #5d6169;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table col.col-category-major { width: 72px; }
.data-table col.col-category-minor { width: 105px; }
.data-table col.col-material { width: 180px; }
.data-table col.col-subject { width: auto; }
.data-table col.col-publish { width: 118px; }
.data-table col.col-status { width: 170px; }
.data-table col.col-updated { width: 145px; }

.flatplan-list-table .table-toolbar {
  grid-template-columns: 1fr auto;
}

.flatplan-list-table .sort-note {
  justify-self: end;
}

.user-list-table .table-toolbar {
  grid-template-columns: 1fr auto;
}

.user-list-table .sort-note {
  justify-self: end;
}

.data-table col.col-flatplan-name { width: auto; }
.data-table col.col-flatplan-publish { width: 130px; }
.data-table col.col-flatplan-count { width: 120px; }
.data-table col.col-flatplan-pages { width: 130px; }
.data-table col.col-flatplan-status { width: 130px; }
.data-table col.col-flatplan-updated { width: 155px; }

.data-table col.col-user-name { width: 180px; }
.data-table col.col-user-email { width: auto; }
.data-table col.col-user-role { width: 140px; }
.data-table col.col-user-status { width: 110px; }
.data-table col.col-user-login { width: 165px; }
.data-table col.col-user-updated { width: 165px; }

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f5f8ff;
}

.subject-cell {
  font-weight: 600;
}

.pagination {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}

.pagination--toolbar {
  min-height: 0;
  justify-content: center;
  padding: 0;
}

.page-number {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}

.page-number:hover {
  background: var(--md-surface-container);
}

.page-number.is-active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 700;
}

/* chips */

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.working {
  background: var(--md-warning-container);
  color: #5e4300;
}

.status-chip.complete {
  background: var(--md-success-container);
  color: #214f33;
}

.user-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.user-status-chip.enabled {
  background: var(--md-success-container);
  color: var(--md-on-success-container);
}

.user-status-chip.disabled {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
}

/* A2 details */

.form-surface {
  padding-bottom: 20px;
}

.article-detail-surface .form-grid {
  padding-top: 20px;
}

.form-grid {
  display: grid;
  gap: 18px;
  padding: 14px 20px 4px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-span {
  grid-column: 1 / -1;
}

.article-state-block {
  display: grid;
  gap: 6px;
}

.article-state-inline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;

  min-height: 32px;
}

.article-state-inline small {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.metadata-surface {
  margin-top: 16px !important;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 20px;
}

.metadata-grid > div {
  padding: 10px 14px;
  border-left: 1px solid #e2e5ea;
}

.metadata-grid > div:first-child {
  border-left: 0;
}

.metadata-grid dt {
  margin-bottom: 4px;
  color: var(--md-on-surface-variant);
  font-size: 11px;
}

.metadata-grid dd {
  margin: 0;
  font-weight: 600;
}

.user-metadata-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Stepper */

.stepper {
  display: flex;
  align-items: center;
  margin: 0 0 24px;
  padding: 14px 18px;
  background: white;
  border: 1px solid #d8dbe2;
  border-radius: var(--radius-m);
  overflow-x: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
  color: var(--md-on-surface-variant);
}

.step span:last-child {
  display: grid;
}

.step small {
  font-size: 10px;
}

.step strong {
  font-size: 12px;
  font-weight: 700;
}

.step-dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 700;
}

.step.is-current {
  color: var(--md-on-primary-container);
}

.step.is-current .step-dot {
  background: var(--md-primary);
  color: white;
}

.step.is-complete .step-dot {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.step-line {
  width: 42px;
  height: 1px;
  flex: 0 0 42px;
  margin: 0 10px;
  background: var(--md-outline-variant);
}

/* B1 */

.flatplan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-bottom: 16px;
}

.flatplan-layout .surface + .surface {
  margin-top: 0;
}

.summary-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-content: center;
  gap: 8px 6px;
  padding: 22px;
}

.summary-card span {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.summary-card strong {
  font-size: 26px;
  line-height: 1;
}

.summary-card small {
  align-self: end;
  color: var(--md-on-surface-variant);
}

.sortable-list,
.publication-list,
.history-list {
  display: grid;
}

.flatplan-empty-state {
  min-height: 170px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 28px;
  color: var(--md-on-surface-variant);
  text-align: center;
}

.flatplan-empty-state strong {
  color: var(--md-on-surface);
}

.sortable-row,
.publication-row,
.history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px;
  border-top: 1px solid #e2e5ea;
}

.sortable-row:first-child,
.publication-row:first-child,
.history-row:first-child {
  border-top: 0;
}

.drag-handle {
  color: #777b82;
  cursor: grab;
  letter-spacing: -2px;
}

.order-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--md-surface-container);
  font-weight: 700;
}

.sortable-main {
  flex: 1;
  display: grid;
}

.sortable-main small {
  margin-top: 2px;
  color: var(--md-on-surface-variant);
}

.page-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

/* B2 */

.cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, .8fr);
  gap: 16px;
}

.cover-layout .surface + .surface {
  margin-top: 0;
}

.template-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 20px 20px;
}

.template-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #f8f9fc;
  cursor: pointer;
  text-align: left;
}

.template-card.is-selected {
  border-color: var(--md-primary);
  background: #f4f7ff;
}

.cover-preview {
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .09);
  overflow: hidden;
}

.cover-preview strong {
  font-size: 18px;
}

.cover-preview small {
  margin-top: 3px;
}

.cover-preview.style-a {
  border-top: 64px solid #315ea8;
}

.cover-preview.style-b {
  border-left: 28px solid #20242b;
}

.cover-preview.style-c {
  background:
    linear-gradient(145deg, rgba(49, 94, 168, .14) 0 40%, white 40% 100%);
}

/* B3 */

.publication-row {
  min-height: 72px;
}

.publication-row > div {
  flex: 1;
  display: grid;
}

.publication-row small {
  margin-top: 2px;
  color: var(--md-on-surface-variant);
}

.publication-row.fixed > span:first-child {
  width: 42px;
  color: var(--md-primary);
  font-size: 11px;
  font-weight: 700;
}

/* B4 */

.preview-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 260px;
  min-height: 610px;
  overflow: hidden;
}

.preview-thumbs {
  padding: 14px 12px;
  border-right: 1px solid #e0e3e8;
  overflow-y: auto;
}

.preview-thumb {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.preview-thumb.is-selected {
  border-color: var(--md-primary);
  background: #f4f7ff;
}

.mini-page {
  width: 68px;
  aspect-ratio: 210 / 297;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 7px;
  background: white;
  border: 1px solid #c9ccd2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.mini-page span {
  height: 6px;
  background: #d6d9df;
}

.mini-page span:nth-child(2) {
  height: 32px;
  background: #e7eaf0;
}

.preview-stage {
  display: grid;
  place-items: center;
  padding: 26px;
  background: #dde1e8;
}

.preview-page {
  width: min(440px, 80%);
  aspect-ratio: 210 / 297;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 52px 48px;
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.preview-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 34%;
  background: var(--md-primary);
}

.preview-cover-title {
  position: relative;
  z-index: 1;
  font-size: 32px;
  font-weight: 800;
}

.preview-cover-month {
  margin-top: 4px;
  font-size: 18px;
}

.preview-cover-rule {
  width: 70px;
  height: 4px;
  margin: 20px 0;
  background: var(--md-primary);
}

.preview-cover-note {
  color: var(--md-on-surface-variant);
}

.preview-info {
  padding: 20px;
  border-left: 1px solid #e0e3e8;
}

.preview-info dl {
  margin: 14px 0 22px;
}

.preview-info dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e4e7ec;
}

.preview-info dt {
  color: var(--md-on-surface-variant);
}

.preview-info dd {
  margin: 0;
  font-weight: 700;
}

/* B5 */

.pdf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 16px;
}

.pdf-layout .surface + .surface {
  margin-top: 0;
}

.output-summary {
  margin: 0;
  padding: 8px 20px 18px;
}

.output-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #e3e6eb;
}

.output-summary dt {
  color: var(--md-on-surface-variant);
}

.output-summary dd {
  margin: 0;
  font-weight: 700;
}

.pdf-layout .large-button {
  margin-left: 20px;
}

.history-row > div {
  flex: 1;
  display: grid;
}

.history-row small {
  color: var(--md-on-surface-variant);
}

/* Placeholder */

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 50px;
}

.empty-state h1,
.empty-state h2,
.empty-state p {
  max-width: 620px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-size: 26px;
}

/* Editor */

.editor-page {
  min-width: 1180px;
  height: 100vh;
  overflow: hidden;
  background: #d9dde4;
}

.editor-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 58px 52px minmax(0, 1fr);
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 14px;
  background: white;
  border-bottom: 1px solid #d9dce2;
}

.editor-title-group,
.editor-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-title-group > div {
  display: grid;
}

.editor-title-group small {
  color: var(--md-on-surface-variant);
  font-size: 10px;
}

.editor-title-group strong {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button {
  font-size: 21px;
}

.save-state {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.save-state.is-saving {
  color: var(--md-primary);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8f9fb;
  border-bottom: 1px solid #cfd3db;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tool-button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
}

.tool-button:hover {
  background: #e9edf3;
}

.tool-button.is-active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 700;
}

.toolbar-divider {
  width: 1px;
  height: 26px;
  background: #cfd3da;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-select {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--md-on-surface-variant);
  font-size: 11px;
}

.toolbar-select select {
  min-height: 34px;
  padding: 0 28px 0 8px;
  border: 1px solid #aeb2b9;
  border-radius: 7px;
  background: white;
}

.editor-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
}

.editor-panel {
  min-height: 0;
  background: #f7f8fa;
  overflow: hidden;
}

.left-panel {
  border-right: 1px solid #c9cdd4;
}

.right-panel {
  border-left: 1px solid #c9cdd4;
}

.panel-tabs {
  display: flex;
  height: 44px;
  border-bottom: 1px solid #d6d9df;
  background: white;
}

.panel-tab {
  position: relative;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.panel-tab.is-active {
  color: var(--md-primary);
}

.panel-tab.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  background: var(--md-primary);
}

.panel-body {
  height: calc(100% - 44px);
  padding: 14px;
  overflow-y: auto;
}

.thumb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.page-thumb {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.page-thumb.is-selected {
  border-color: var(--md-primary);
  background: #edf3ff;
}

.thumb-paper {
  width: 72px;
  aspect-ratio: 210 / 297;
  position: relative;
  display: block;
  background: white;
  border: 1px solid #bfc3ca;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.thumb-block {
  position: absolute;
  left: 8px;
  right: 8px;
  background: #dce0e6;
}

.thumb-block.title {
  top: 10px;
  height: 8px;
  background: #7a92bb;
}

.thumb-block.image {
  top: 27px;
  height: 38px;
  background: #d3d8e1;
}

.thumb-block.image.bottom {
  top: 52px;
  height: 25px;
}

.thumb-block.line {
  top: 72px;
  height: 5px;
}

.thumb-block.line.short {
  top: 29px;
  right: 28px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid #c8ccd3;
  border-radius: 9px;
  background: white;
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-weight: 700;
}

.asset-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.asset-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #d6d9df;
  border-radius: 9px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.asset-placeholder {
  width: 46px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #e3e6ec;
  color: #727780;
  font-size: 8px;
  font-weight: 700;
}

.asset-card > span:last-child {
  display: grid;
}

.asset-card small {
  color: var(--md-on-surface-variant);
  font-size: 10px;
}

.canvas-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(#cdd2da 1px, transparent 1px),
    linear-gradient(90deg, #cdd2da 1px, transparent 1px),
    #d9dde4;
  background-size: 10px 10px;
}

.ruler {
  position: sticky;
  z-index: 5;
  background:
    repeating-linear-gradient(90deg, #adb2bb 0 1px, transparent 1px 10px),
    #eef0f3;
  opacity: .85;
}

.ruler-top {
  top: 0;
  left: 0;
  height: 20px;
  margin-left: 20px;
}

.ruler-left {
  position: absolute;
  top: 20px;
  left: 0;
  width: 20px;
  bottom: 0;
  background:
    repeating-linear-gradient(#adb2bb 0 1px, transparent 1px 10px),
    #eef0f3;
}

.canvas-stage {
  min-width: 760px;
  min-height: 900px;
  display: grid;
  place-items: start center;
  padding: 42px 40px 80px 58px;
}

.paper-canvas {
  position: relative;
  width: 560px;
  aspect-ratio: 210 / 297;
  background: white;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  overflow: hidden;
}

.bleed-guide {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(49, 94, 168, .35);
  pointer-events: none;
}

.sample-kicker {
  position: absolute;
  top: 48px;
  left: 52px;
  color: var(--md-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.sample-title {
  position: absolute;
  top: 76px;
  left: 50px;
  right: 44px;
  padding: 4px;
  font-size: 27px;
  line-height: 1.35;
  font-weight: 800;
}

.selected-object {
  outline: 2px solid var(--md-primary);
  outline-offset: 3px;
}

.selected-object::before,
.selected-object::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--md-primary);
  background: white;
}

.selected-object::before {
  left: -8px;
  top: -8px;
}

.selected-object::after {
  right: -8px;
  bottom: -8px;
}

.sample-image {
  position: absolute;
  top: 164px;
  left: 50px;
  right: 50px;
  height: 285px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(49, 94, 168, .12), rgba(49, 94, 168, .03)),
    #e8ebef;
}

.sample-image::before,
.sample-image::after {
  content: "";
  position: absolute;
  background: #bcc6d8;
  border-radius: 18px;
  transform: rotate(-10deg);
}

.sample-image::before {
  width: 210px;
  height: 98px;
}

.sample-image::after {
  width: 90px;
  height: 180px;
  transform: rotate(24deg);
}

.sample-image-mark {
  position: relative;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .82);
  color: #6e7480;
  font-size: 10px;
  font-weight: 700;
}

.sample-copy {
  position: absolute;
  top: 480px;
  left: 50px;
  right: 92px;
}

.sample-copy strong {
  display: block;
  margin-bottom: 9px;
  font-size: 16px;
}

.sample-copy p {
  font-size: 11px;
  line-height: 1.8;
}

.sample-qr {
  position: absolute;
  right: 50px;
  bottom: 54px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 5px solid #25282d;
  background:
    repeating-linear-gradient(45deg, #25282d 0 3px, white 3px 6px);
  color: white;
  font-size: 9px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
}

.sample-footer {
  position: absolute;
  left: 50px;
  bottom: 66px;
  color: #696e76;
  font-size: 9px;
}

.property-section + .property-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #dfe2e7;
}

.inline-fields,
.quad-fields {
  display: grid;
  gap: 8px;
}

.inline-fields {
  grid-template-columns: repeat(2, 1fr);
}

.quad-fields {
  grid-template-columns: repeat(2, 1fr);
}

.property-panel .field + .field {
  margin-top: 10px;
}

.layer-list {
  display: grid;
  gap: 5px;
}

.layer-item {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.layer-item.is-selected {
  background: var(--md-primary-container);
}

.layer-item span,
.layer-item small {
  color: var(--md-on-surface-variant);
  font-size: 9px;
}

.check-summary,
.check-item {
  padding: 12px;
  border-radius: 9px;
}

.check-summary.success {
  background: var(--md-success-container);
  color: #1f4d31;
}

.check-summary p,
.check-item p {
  margin: 5px 0 0;
  font-size: 11px;
}

.check-item.warning {
  margin-top: 10px;
  background: var(--md-warning-container);
  color: #5e4300;
}

/* Common UI patterns */

.ui-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ui-pattern-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.ui-pattern-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ui-pattern-card__header h2 {
  margin-bottom: 5px;
}

.ui-pattern-card__header p {
  margin-bottom: 0;
  font-size: 12px;
}

.ui-pattern-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-size: 11px;
  font-weight: 800;
}

.ui-pattern-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.ui-pattern-note {
  margin-top: auto;
  padding-top: 20px;
  color: var(--md-on-surface-variant);
  font-size: 12px;
  line-height: 1.7;
}

.ui-stack-preview {
  position: relative;
  height: 112px;
  margin-top: 20px;
}

.ui-stack-preview__base,
.ui-stack-preview__detail,
.ui-stack-preview__confirm {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(16, 24, 40, .08);
}

.ui-stack-preview__base {
  inset: 18px 58px 0 0;
  background: #f1f3f7;
  color: var(--md-on-surface-variant);
}

.ui-stack-preview__detail {
  inset: 8px 28px 10px 30px;
  background: white;
}

.ui-stack-preview__confirm {
  inset: 0 0 22px 76px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.ui-pattern-rules {
  margin-top: 16px !important;
}

.ui-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0 20px 20px;
}

.ui-rule-list > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #e4e7ec;
}

.ui-rule-list strong {
  font-size: 12px;
}

.ui-rule-list span {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

/* Dialog / toast */

.modal-dialog {
  width: min(440px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: white;
  color: var(--md-on-surface);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
  overflow: auto;
}

.modal-dialog--detail {
  width: min(620px, calc(100vw - 48px));
}

.modal-dialog--confirm {
  width: min(440px, calc(100vw - 48px));
}

.modal-dialog::backdrop {
  background: rgba(26, 28, 30, .42);
}

.modal-dialog[data-modal-level="2"]::backdrop {
  background: rgba(26, 28, 30, .28);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #e4e7ec;
}

.modal-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.modal-eyebrow {
  color: var(--md-primary);
  font-size: 11px;
  font-weight: 800;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body > p:last-child {
  margin-bottom: 0;
}

.modal-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0 0 20px;
}

.modal-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e7e9ed;
}

.modal-detail-list dt {
  color: var(--md-on-surface-variant);
  font-size: 12px;
}

.modal-detail-list dd {
  margin: 0;
  font-weight: 600;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e4e7ec;
}

.dialog-actions form {
  display: contents;
}

.dialog-actions--spread {
  justify-content: space-between;
}

.dialog-actions--spread > div {
  display: flex;
  gap: 8px;
}

/* The native dialog top layer provides focus containment and proper modal stacking. */

/* Toast is also promoted to the browser Top Layer with popover="manual". */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 2147483647;
  width: max-content;
  min-width: 300px;
  max-width: min(560px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--md-outline-variant);
  border-inline-start: 4px solid var(--md-info);
  border-radius: 12px;
  background: var(--md-info-container);
  color: var(--md-on-info-container);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .16s ease, transform .16s ease;
}

.toast[data-type="success"] {
  background: var(--md-success-container);
  color: var(--md-on-success-container);
  border-inline-start-color: var(--md-success);
}

.toast[data-type="info"] {
  background: var(--md-info-container);
  color: var(--md-on-info-container);
  border-inline-start-color: var(--md-info);
}

.toast[data-type="warning"] {
  background: var(--md-warning-container);
  color: var(--md-on-warning-container);
  border-inline-start-color: var(--md-warning);
}

.toast[data-type="error"] {
  background: var(--md-error-container);
  color: var(--md-on-error-container);
  border-inline-start-color: var(--md-error);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transform: translate(-50%, 0);
    transition: opacity .08s ease;
  }
}

@media (max-width: 1366px) {
  :root {
    --side-width: 220px;
  }

  .page-content {
    padding: 20px 22px 36px;
  }

  .data-table th,
  .data-table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .metadata-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 8px;
  }

  .metadata-grid > div:nth-child(3) {
    border-left: 0;
  }

  .editor-workspace {
    grid-template-columns: 210px minmax(0, 1fr) 280px;
  }

  .paper-canvas {
    width: 500px;
  }
}

/* A1-A3 prototype sync */
.status-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.status-cell small {
  color: var(--md-on-surface-variant);
  font-size: 10px;
}

.required-mark {
  margin-left: 4px;
  color: var(--md-error);
  font-size: 10px;
  font-weight: 700;
}

.field-error {
  margin-top: 3px;
  color: var(--md-error);
  font-size: 11px;
}

.field.is-error input,
.field.is-error select {
  border-color: var(--md-error);
}

.layout-start-options {
  display: grid;
  gap: 10px;
}

.layout-start-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  cursor: pointer;
}

.layout-start-option.is-selected {
  border-color: var(--md-primary);
  background: #f4f7ff;
}

.layout-start-option span {
  display: grid;
  gap: 3px;
}

.layout-start-option small {
  color: var(--md-on-surface-variant);
}

.compact-template-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 0 0;
}

.compact-template-cards .template-card {
  min-height: 76px;
}

.page-add-wrap {
  position: relative;
}

.page-add-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 10;
  padding: 5px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 9px;
  background: white;
  box-shadow: var(--md-shadow);
}

.page-add-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.page-add-menu button:hover {
  background: var(--md-surface-container);
}

.selected-product-context {
  margin-bottom: 12px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}

.selected-product-context small,
.selected-product-context strong,
.selected-product-context span {
  display: block;
}

.selected-product-context small {
  font-size: 9px;
  font-weight: 700;
}

.selected-product-context strong {
  margin-top: 2px;
  font-size: 12px;
}

.selected-product-context span {
  margin-top: 1px;
  font-size: 10px;
}

.product-detail {
  margin-top: 10px;
}

.product-back {
  padding-left: 0;
}

.product-detail-heading {
  display: grid;
  gap: 2px;
  margin: 8px 0 14px;
}

.product-detail-heading small {
  color: var(--md-on-surface-variant);
}

.material-section + .material-section {
  margin-top: 16px;
}

.material-section h3 {
  margin-bottom: 7px;
  color: var(--md-on-surface-variant);
  font-size: 11px;
}

.material-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #d6d9df;
  border-radius: 8px;
  background: white;
  cursor: grab;
  text-align: left;
}

.material-item small {
  color: var(--md-on-surface-variant);
  font-size: 9px;
}

.material-item.image-item {
  justify-content: flex-start;
}

.canvas-controls {
  position: sticky;
  left: 100%;
  bottom: 14px;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -54px 16px 16px auto;
  padding: 4px;
  border: 1px solid var(--md-outline-variant);
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--md-shadow);
  z-index: 8;
}

.canvas-controls button {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.canvas-controls button:hover {
  background: var(--md-surface-container);
}

.paper-canvas.is-placement-mode {
  cursor: crosshair;
}

.placed-object {
  position: absolute;
  z-index: 3;
  min-width: 120px;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid #c5c9d1;
  border-radius: 5px;
  background: white;
  white-space: pre-line;
  cursor: move;
  font-size: 12px;
  line-height: 1.45;
}

.placed-image {
  width: 180px;
  height: 110px;
  display: grid;
  place-items: center;
  background: #e8ebef;
  color: #666c76;
  text-align: center;
}

.placed-smallgroup {
  width: 205px;
  min-height: 86px;
  background: #f5f7fb;
  font-weight: 700;
}

.placed-commonpart {
  background: #fff8e8;
}

.compact-meta {
  margin: 0;
}

.compact-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
}

.compact-meta dt {
  color: var(--md-on-surface-variant);
  font-size: 10px;
}

.compact-meta dd {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
}

.property-note {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.6;
}

.editor-preview-dialog {
  width: min(940px, calc(100vw - 56px));
}

.preview-dialog-body {
  padding: 0;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
}

.article-preview-stage {
  min-height: 560px;
  display: grid;
  place-items: center;
  padding: 26px;
  background: #dde1e8;
}

.article-preview-page {
  width: 390px;
  aspect-ratio: 210 / 297;
  position: relative;
  padding: 40px;
  background: white;
  box-shadow: 0 7px 24px rgba(0,0,0,.18);
}

.article-preview-page > small {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--md-on-surface-variant);
}

.article-preview-page > strong {
  display: block;
  margin-top: 20px;
  font-size: 22px;
}

.preview-product-block {
  height: 210px;
  margin: 28px 0 22px;
  border-radius: 4px;
  background: #e7ebf2;
}

/* A3 editor layout v3 */
body.editor-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-width: 1180px;
  overflow: hidden;
  background: #cfd4db;
  color: #20242b;
}

.editor-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 60px 58px minmax(0, 1fr);
  overflow: hidden;
  background: #cfd4db;
}

.editor-topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px 0 10px;
  background: #fff;
  border-bottom: 1px solid #d8dce2;
  box-shadow: 0 1px 2px rgba(25, 31, 40, .05);
}

.editor-title-group,
.editor-status,
.editor-edit-state {
  display: flex;
  align-items: center;
}

.editor-title-group {
  min-width: 0;
  gap: 12px;
}

.editor-back-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #3e4652;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
}

.editor-back-button:hover {
  background: #eef1f5;
}

.editor-document-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.editor-document-heading strong {
  max-width: 520px;
  overflow: hidden;
  color: #1f242b;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-document-heading small {
  color: #77808d;
  font-size: 10px;
  font-weight: 500;
}

.editor-title-separator {
  width: 1px;
  height: 28px;
  background: #d9dde3;
}

.editor-edit-state {
  gap: 9px;
  color: #626a76;
  font-size: 11px;
}

.editor-edit-state .status-chip {
  min-height: 26px;
}

.editor-status {
  gap: 8px;
}

.editor-action-button {
  min-height: 38px;
  padding-inline: 17px;
}

.editor-toolbar {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #f7f8fa;
  border-bottom: 1px solid #cbd0d8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .75) inset;
}

.editor-toolbar .tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.editor-toolbar .toolbar-divider {
  width: 1px;
  height: 32px;
  margin: 0 5px;
  background: #d2d6dc;
}

.editor-toolbar .toolbar-spacer {
  flex: 1;
}

.editor-toolbar .tool-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #39404a;
  cursor: pointer;
}

.editor-toolbar .tool-button:hover {
  border-color: #d7dbe1;
  background: #fff;
}

.editor-toolbar .tool-button.is-active {
  border-color: #b7c8e7;
  background: #e3ecff;
  color: #1f5ba7;
}

.tool-button--icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
}

.tool-button--tool {
  width: 48px;
  height: 48px;
  display: grid;
  grid-template-rows: 24px 14px;
  place-items: center;
  padding: 2px 3px;
}

.tool-button--tool .tool-glyph {
  font-size: 18px;
  line-height: 1;
}

.tool-button--tool .tool-glyph--text {
  font-family: Georgia, serif;
  font-weight: 700;
}

.tool-button--tool small {
  font-size: 9px;
  font-weight: 700;
}

.tool-button--menu {
  min-height: 36px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

.editor-toolbar-context {
  min-width: 112px;
  display: grid;
  justify-items: end;
  gap: 1px;
  padding-right: 4px;
}

.editor-toolbar-context span {
  color: #7b838e;
  font-size: 9px;
}

.editor-toolbar-context strong {
  color: #3f4650;
  font-size: 11px;
}

.editor-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  overflow: hidden;
  transition: grid-template-columns .16s ease;
}

.editor-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f8f9fb;
}

.left-panel {
  border-right: 1px solid #c8cdd5;
}

.right-panel {
  border-left: 1px solid #c8cdd5;
}

.panel-tabs {
  height: 46px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #d9dde3;
  background: #fff;
}

.panel-tabs--with-toggle {
  gap: 0;
}

.panel-tab-set {
  min-width: 0;
  flex: 1;
  display: flex;
}

.panel-tab {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #616976;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.panel-tab:hover {
  background: #f5f7fa;
}

.panel-tab.is-active {
  color: #245fae;
}

.panel-tab.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #2f67b8;
}

.panel-collapse-button {
  width: 34px;
  flex: 0 0 34px;
  border: 0;
  border-left: 1px solid #e1e4e8;
  background: #fff;
  color: #737b86;
  font-size: 20px;
  cursor: pointer;
}

.panel-tabs--right .panel-collapse-button {
  order: -1;
  border-right: 1px solid #e1e4e8;
  border-left: 0;
}

.panel-collapse-button:hover {
  background: #eef2f6;
  color: #2f67b8;
}

.panel-body {
  height: calc(100% - 46px);
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #aeb5bf transparent;
}

.panel-content-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-content-heading > div {
  display: grid;
  gap: 2px;
}

.panel-content-heading strong {
  color: #353b44;
  font-size: 12px;
}

.panel-content-heading small {
  color: #858c96;
  font-size: 9px;
}

.panel-content-heading > span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #edf0f4;
  color: #666e79;
  font-size: 10px;
  font-weight: 700;
}

.editor-shell.is-left-collapsed .editor-workspace {
  grid-template-columns: 35px minmax(0, 1fr) 320px;
}

.editor-shell.is-right-collapsed .editor-workspace {
  grid-template-columns: 260px minmax(0, 1fr) 35px;
}

.editor-shell.is-left-collapsed.is-right-collapsed .editor-workspace {
  grid-template-columns: 35px minmax(0, 1fr) 35px;
}

.editor-shell.is-left-collapsed .left-panel .panel-tab-set,
.editor-shell.is-left-collapsed .left-panel .panel-body,
.editor-shell.is-right-collapsed .right-panel .panel-tab-set,
.editor-shell.is-right-collapsed .right-panel .panel-body {
  display: none !important;
}

.editor-shell.is-left-collapsed .left-panel .panel-tabs,
.editor-shell.is-right-collapsed .right-panel .panel-tabs {
  height: 100%;
  border-bottom: 0;
}

.editor-shell.is-left-collapsed .left-panel .panel-collapse-button,
.editor-shell.is-right-collapsed .right-panel .panel-collapse-button {
  width: 34px;
  height: 46px;
  border: 0;
}

.page-panel-body,
.asset-panel-body,
.layer-panel-body {
  background: #f8f9fb;
}

.thumb-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.page-thumb {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.page-thumb:hover {
  background: #f0f3f7;
}

.page-thumb.is-selected {
  border-color: #2f67b8;
  background: #e8f0ff;
  box-shadow: 0 0 0 1px rgba(47, 103, 184, .06);
}

.page-thumb-number {
  display: none;
}

.thumb-paper {
  width: 72px;
  aspect-ratio: 210 / 297;
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid #c3c8d0;
  box-shadow: 0 2px 7px rgba(29, 35, 43, .14);
}

.page-thumb-description {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: center;
}

.page-thumb-description strong,
.page-thumb > strong {
  color: #323841;
  font-size: 11px;
}

.page-thumb-description strong::before,
.page-thumb > strong::before {
  content: "ページ ";
  color: #7b838f;
  font-size: 9px;
  font-weight: 500;
}

.page-thumb-description small {
  color: #868e99;
  font-size: 9px;
}

.page-thumb-menu {
  color: #7b838f;
  font-size: 17px;
  line-height: 1;
}

.page-add-wrap {
  position: relative;
  margin-top: 10px;
}

.editor-page-add {
  min-height: 40px;
  border: 1px solid #c3d2ed;
  border-radius: 9px;
}

.page-add-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  overflow: hidden;
  border: 1px solid #d5d9df;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(24, 30, 38, .14);
}

.page-add-menu button {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid #eceef2;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.page-add-menu button:last-child {
  border-bottom: 0;
}

.page-add-menu button:hover {
  background: #f4f7fb;
}

.page-add-menu button strong {
  font-size: 11px;
}

.page-add-menu button small {
  color: #7e8691;
  font-size: 9px;
}

.material-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid #d2d7de;
  border-radius: 9px;
  background: #edf0f4;
}

.material-segments button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #666e79;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.material-segments button.is-active {
  background: #fff;
  color: #245fae;
  box-shadow: 0 1px 3px rgba(31, 37, 46, .12);
}

.asset-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.asset-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #d8dce2;
  border-radius: 9px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.asset-card:hover {
  border-color: #adbed9;
  background: #f8faff;
}

.asset-placeholder {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
  background: #e4e8ee;
  color: #747c87;
  font-size: 8px;
  font-weight: 800;
}

.asset-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.asset-card strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card small {
  color: #818995;
  font-size: 9px;
}

.canvas-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(#c8cdd4 1px, transparent 1px),
    linear-gradient(90deg, #c8cdd4 1px, transparent 1px),
    #d2d6dc;
  background-size: 10px 10px;
}

.ruler-corner {
  position: absolute;
  z-index: 14;
  top: 0;
  left: 0;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-right: 1px solid #c0c5cc;
  border-bottom: 1px solid #c0c5cc;
  background: #f2f4f6;
  color: #8b929c;
  font-size: 8px;
}

.ruler {
  position: absolute;
  z-index: 13;
  background-color: #f2f4f6;
  color: #858d98;
  font-size: 8px;
  opacity: 1;
}

.ruler-top {
  top: 0;
  left: 23px;
  right: 0;
  height: 23px;
  border-bottom: 1px solid #c0c5cc;
  background-image: repeating-linear-gradient(90deg, #aeb4bd 0 1px, transparent 1px 10px);
}

.ruler-top span {
  position: absolute;
  top: 3px;
  transform: translateX(2px);
}

.ruler-left {
  top: 23px;
  left: 0;
  bottom: 46px;
  width: 23px;
  border-right: 1px solid #c0c5cc;
  background-image: repeating-linear-gradient(#aeb4bd 0 1px, transparent 1px 10px);
}

.ruler-left span {
  position: absolute;
  left: 3px;
  transform: translateY(2px) rotate(-90deg);
  transform-origin: left top;
}

.canvas-viewport {
  position: absolute;
  inset: 23px 0 46px 23px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9fa6b0 transparent;
}

.canvas-stage {
  width: 100%;
  min-width: 570px;
  min-height: 100%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 24px;
}

.paper-canvas {
  position: relative;
  width: 470px;
  aspect-ratio: 210 / 297;
  flex: 0 0 auto;
  overflow: visible;
  border: 1px solid #b9bec6;
  background: #fff;
  box-shadow:
    0 1px 1px rgba(30, 35, 43, .12),
    0 12px 34px rgba(30, 35, 43, .20);
}

.canvas-guide {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.canvas-guide--vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(44, 101, 180, .18);
}

.canvas-guide--horizontal {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(44, 101, 180, .18);
}

.sample-kicker {
  top: 40px;
  left: 43px;
  font-size: 9px;
}

.sample-title {
  top: 62px;
  left: 41px;
  right: 38px;
  padding: 4px;
  font-size: 22px;
}

.sample-image {
  top: 138px;
  left: 41px;
  right: 41px;
  height: 239px;
}

.sample-copy {
  top: 405px;
  left: 41px;
  right: 74px;
}

.sample-copy strong {
  font-size: 14px;
}

.sample-copy p {
  font-size: 10px;
  line-height: 1.75;
}

.sample-footer {
  left: 41px;
  bottom: 52px;
}

.selected-object {
  outline: 1px solid #2f67b8;
  outline-offset: 2px;
}

.selected-object::before,
.selected-object::after {
  width: 6px;
  height: 6px;
  border: 1px solid #2f67b8;
  background: #fff;
  box-shadow: 0 0 0 1px #fff;
}

.canvas-footer {
  position: absolute;
  z-index: 15;
  left: 23px;
  right: 0;
  bottom: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-top: 1px solid #c6cbd2;
  background: rgba(244, 246, 248, .96);
  backdrop-filter: blur(6px);
}

.canvas-page-indicator {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #6f7782;
  font-size: 10px;
}

.canvas-page-indicator strong {
  color: #303741;
  font-size: 12px;
}

.canvas-controls {
  position: static;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #d0d5dc;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 37, 46, .08);
}

.canvas-controls button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #454c56;
  font-size: 10px;
  cursor: pointer;
}

.canvas-controls button:hover {
  background: #eef2f6;
}

.canvas-zoom-value {
  min-width: 52px !important;
  font-variant-numeric: tabular-nums;
}

.canvas-control-divider {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: #d9dde2;
}

.right-panel .panel-body {
  padding: 0;
  background: #f8f9fb;
}

.property-selection-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid #dfe3e8;
  background: #fff;
}

.property-type-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e4edff;
  color: #245fae;
  font-size: 16px;
  font-weight: 800;
}

.property-selection-summary > div {
  display: grid;
  gap: 1px;
}

.property-selection-summary strong {
  color: #343a43;
  font-size: 12px;
}

.property-selection-summary small {
  color: #7e8691;
  font-size: 9px;
}

.property-panel > .property-section {
  margin: 0;
  padding: 16px 14px;
  border-top: 0;
  border-bottom: 1px solid #dfe3e8;
}

.property-panel > .property-section + .property-section {
  margin: 0;
  padding-top: 16px;
  border-top: 0;
}

.property-section h3 {
  margin: 0 0 11px;
  color: #383e47;
  font-size: 11px;
  font-weight: 800;
}

.property-panel .field {
  gap: 5px;
}

.property-panel .field > span {
  min-height: 15px;
  color: #656d78;
  font-size: 9px;
  font-weight: 700;
}

.property-panel .field span em {
  margin-left: 3px;
  color: #8a929c;
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
}

.property-panel .field input,
.property-panel .field select {
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  border-color: #c5cbd3;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}

.property-panel .inline-fields,
.property-panel .quad-fields {
  gap: 7px;
}

.property-panel .quad-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.property-panel .field + .field {
  margin-top: 0;
}

.property-secondary-row {
  margin-top: 8px;
}

.text-format-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 9px;
}

.text-format-controls button {
  min-height: 32px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #444b55;
  cursor: pointer;
}

.text-format-controls button:hover {
  background: #f2f5f8;
}

.text-format-controls button.is-active {
  border-color: #b6c9e9;
  background: #e5edff;
  color: #245fae;
}

.text-align-controls button {
  font-size: 15px;
  line-height: 1;
}

.text-color-swatch {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
  background: #20242b;
  vertical-align: middle;
}

.layer-panel-body .panel-content-heading {
  padding: 14px 14px 4px;
  margin-bottom: 4px;
}

.layer-list {
  display: grid;
  gap: 3px;
  padding: 0 10px 14px;
}

.layer-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.layer-item:hover {
  background: #edf1f5;
}

.layer-item.is-selected {
  border-color: #c0d1ef;
  background: #e5edff;
}

.layer-item strong {
  overflow: hidden;
  color: #3a4049;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-item span,
.layer-item small {
  color: #7c8490;
  font-size: 8px;
}

.layer-visibility {
  color: #6d7785 !important;
  font-size: 7px !important;
}

.provenance-section {
  background: #fbfcfd;
}

@media (max-width: 1280px) {
  .editor-workspace {
    grid-template-columns: 230px minmax(0, 1fr) 290px;
  }

  .editor-shell.is-left-collapsed .editor-workspace {
    grid-template-columns: 35px minmax(0, 1fr) 290px;
  }

  .editor-shell.is-right-collapsed .editor-workspace {
    grid-template-columns: 230px minmax(0, 1fr) 35px;
  }

  .paper-canvas {
    width: 440px;
  }

  .sample-image {
    height: 224px;
  }

  .sample-copy {
    top: 380px;
  }

  .editor-edit-state > span {
    display: none;
  }

  .editor-toolbar-context {
    display: none;
  }
}

/* A3 editor refinement: fit-page canvas and richer selection/inspector */
.canvas-stage {
  padding: 28px;
}

.paper-canvas {
  container-type: inline-size;
  width: min(
    720px,
    calc((100dvh - 210px) * .7070707),
    calc(100% - 72px)
  );
  min-width: 420px;
  max-width: 720px;
}

.canvas-guide {
  display: none;
}

.sample-kicker {
  top: 6cqw;
  left: 9.2cqw;
  font-size: 1.95cqw;
}

.sample-title {
  top: 9.3cqw;
  left: 8.7cqw;
  right: 8.1cqw;
  padding: .85cqw;
  font-size: 4.7cqw;
  line-height: 1.28;
}

.sample-image {
  top: 29.3cqw;
  left: 8.7cqw;
  right: 8.7cqw;
  height: 50.9cqw;
}

.sample-image::before {
  width: 44.7cqw;
  height: 20.8cqw;
}

.sample-image::after {
  width: 19.1cqw;
  height: 38.3cqw;
}

.sample-image-mark {
  padding: 1.5cqw 2.1cqw;
  border-radius: 1.3cqw;
  font-size: 2.1cqw;
}

.sample-copy {
  top: 86.2cqw;
  left: 8.7cqw;
  right: 15.7cqw;
}

.sample-copy strong {
  margin-bottom: 1.9cqw;
  font-size: 3cqw;
}

.sample-copy p {
  font-size: 2.1cqw;
  line-height: 1.75;
}

.sample-footer {
  left: 8.7cqw;
  bottom: 7.8cqw;
  font-size: 1.9cqw;
}

.selected-object--demo::before,
.selected-object--demo::after {
  display: none;
}

.selection-handle,
.rotation-handle {
  position: absolute;
  z-index: 5;
  display: block;
  box-sizing: border-box;
  border: 1px solid #2f67b8;
  background: #fff;
  pointer-events: none;
}

.selection-handle {
  width: 7px;
  height: 7px;
}

.handle-nw { left: -6px; top: -6px; }
.handle-n  { left: calc(50% - 3px); top: -6px; }
.handle-ne { right: -6px; top: -6px; }
.handle-e  { right: -6px; top: calc(50% - 3px); }
.handle-se { right: -6px; bottom: -6px; }
.handle-s  { left: calc(50% - 3px); bottom: -6px; }
.handle-sw { left: -6px; bottom: -6px; }
.handle-w  { left: -6px; top: calc(50% - 3px); }

.rotation-handle {
  left: calc(50% - 5px);
  top: -28px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.rotation-handle::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 1px;
  height: 16px;
  background: #2f67b8;
}

.property-choice-row {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.property-choice-row > span {
  color: #656d78;
  font-size: 9px;
  font-weight: 700;
}

.property-choice-row > div {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.property-choice-row button {
  min-height: 32px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #555d68;
  font-size: 10px;
  cursor: pointer;
}

.property-choice-row button.is-active {
  border-color: #b6c9e9;
  background: #e5edff;
  color: #245fae;
  font-weight: 700;
}

@media (max-height: 820px) {
  .paper-canvas {
    width: min(
      620px,
      calc((100dvh - 180px) * .7070707),
      calc(100% - 56px)
    );
    min-width: 390px;
  }

  .canvas-stage {
    padding: 20px;
  }
}

/* A3 mode-specific review states */
.editor-shell {
  position: relative;
}

.editor-toolbar .tool-button.is-mode-current:not(.is-active),
.editor-toolbar .tool-button.is-menu-open {
  border-color: #b7c8e7;
  background: #e3ecff;
  color: #1f5ba7;
}

.editor-toolbar-flyouts {
  position: absolute;
  z-index: 50;
  top: 118px;
  left: 112px;
  pointer-events: none;
}

.editor-toolbar-flyout {
  width: 330px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfd4db;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(26, 32, 40, .18);
  pointer-events: auto;
}

.editor-toolbar-flyout[hidden] {
  display: none !important;
}

.editor-toolbar-flyout--wide {
  width: 560px;
}

.flyout-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.flyout-heading strong {
  color: #343a43;
  font-size: 12px;
}

.flyout-heading span {
  color: #818995;
  font-size: 9px;
}

.flyout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.flyout-grid--shapes {
  grid-template-columns: repeat(3, 1fr);
}

.flyout-grid button {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid #d4d9e0;
  border-radius: 8px;
  background: #fff;
  color: #3f4650;
  font-size: 18px;
  cursor: pointer;
}

.flyout-grid button:hover,
.flyout-actions button:hover {
  border-color: #aebfda;
  background: #f6f9ff;
}

.flyout-grid button span {
  font-size: 9px;
}

.flyout-section {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid #e2e5ea;
}

.flyout-section > span {
  color: #6f7782;
  font-size: 9px;
  font-weight: 700;
}

.flyout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flyout-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d2d7de;
  border-radius: 6px;
  background: #fff;
  color: #4f5762;
  font-size: 9px;
  cursor: pointer;
}

.flyout-actions--checks button.is-on {
  border-color: #aec3e8;
  background: #e4edff;
  color: #245fae;
  font-weight: 700;
}

[data-property-mode][hidden],
[data-property-common][hidden] {
  display: none !important;
}

.property-mode-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.property-mode-heading h3 {
  margin-bottom: 0;
}

.property-mode-heading span {
  color: #8a929d;
  font-size: 8px;
}

.property-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.property-choice-row--three {
  grid-template-columns: repeat(3, 1fr) !important;
}

.property-action-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.property-action-row button {
  min-height: 32px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #555d68;
  font-size: 9px;
  cursor: pointer;
}

.property-action-row button:hover {
  background: #eef3f8;
}

.review-property-note {
  margin: 8px 0 0;
  color: #7c8490;
  font-size: 8px;
  line-height: 1.5;
}

.layer-review-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 0 14px 10px;
}

.layer-review-actions button {
  min-height: 30px;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  color: #59616d;
  font-size: 8px;
  cursor: pointer;
}

.layer-review-actions button:hover {
  background: #eef3f8;
}

.layer-item--group {
  margin-top: 6px;
  background: #f0f3f7;
}

.layer-item--child {
  margin-left: 16px;
  grid-template-columns: 24px minmax(0, 1fr) 30px;
}

@media (max-width: 1280px) {
  .editor-toolbar-flyouts {
    left: 82px;
  }

  .editor-toolbar-flyout--wide {
    width: 500px;
  }
}

/* A3-02 text editing state */
.text-edit-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #b8caea;
  border-radius: 8px;
  background: #edf3ff;
}

.text-edit-status[hidden] {
  display: none !important;
}

.text-edit-status > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.text-edit-status strong {
  color: #255b9f;
  font-size: 10px;
}

.text-edit-status span {
  color: #66788f;
  font-size: 8px;
  line-height: 1.45;
}

.text-edit-status kbd {
  min-width: 34px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid #c8d2df;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: #586271;
  font-family: inherit;
  font-size: 8px;
}

.text-edit-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.text-edit-controls[hidden],
.text-edit-utility-row[hidden],
.text-frame-padding-detail[hidden],
.text-overflow-warning[hidden] {
  display: none !important;
}

.text-edit-controls button {
  min-height: 42px;
  display: grid;
  grid-template-rows: 18px 12px;
  place-items: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #454c56;
  cursor: pointer;
}

.text-edit-controls button:hover {
  background: #f1f5fa;
}

.text-edit-controls button > span {
  font-size: 13px;
  line-height: 1;
}

.text-edit-controls button small {
  color: #747d88;
  font-size: 7px;
}

.text-edit-utility-row {
  display: grid;
  grid-template-columns: 1.3fr .85fr 1fr;
  gap: 5px;
  margin-top: 8px;
}

.text-edit-utility-row button {
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #535b66;
  font-size: 8px;
  font-weight: 600;
  cursor: pointer;
}

.text-edit-utility-row button:hover,
.text-edit-utility-row button.is-active {
  border-color: #b7c8e7;
  background: #e8f0ff;
  color: #245fae;
}

.text-edit-popover {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 8px;
  margin-top: 7px;
  padding: 9px;
  border: 1px solid #cdd4dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(28, 34, 42, .10);
}

.text-edit-popover[hidden] {
  display: none !important;
}

.text-edit-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.text-edit-popover-heading strong {
  color: #404751;
  font-size: 9px;
}

.text-edit-popover-heading button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #737c87;
  cursor: pointer;
}

.text-edit-popover-heading button:hover {
  background: #eef2f6;
}

.special-character-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.special-character-grid button {
  min-height: 30px;
  border: 1px solid #d5dae0;
  border-radius: 5px;
  background: #fff;
  color: #343a43;
  font-size: 12px;
  cursor: pointer;
}

.special-character-grid button:hover {
  border-color: #afc1df;
  background: #f2f6ff;
}

.text-edit-popover .field {
  gap: 3px;
}

.text-edit-popover-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.text-edit-popover-actions button {
  min-height: 29px;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  color: #555e69;
  font-size: 8px;
  cursor: pointer;
}

.text-frame-padding-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d6dbe2;
}

.text-frame-padding-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.text-frame-padding-heading > span {
  color: #656d78;
  font-size: 9px;
  font-weight: 700;
}

.text-frame-padding-heading > small {
  color: #8b929c;
  font-size: 7px;
}

.text-overflow-warning {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #e7b5b9;
  border-radius: 8px;
  background: #fff3f3;
}

.text-overflow-warning strong {
  color: #9b343d;
  font-size: 9px;
}

.text-overflow-warning span {
  color: #805b60;
  font-size: 8px;
  line-height: 1.45;
}

.text-edit-caret,
.text-overflow-indicator {
  display: none;
}

.editor-shell.is-text-editing .sample-title.is-text-edit-target {
  outline: 2px solid #2f67b8;
  outline-offset: 2px;
}

.editor-shell.is-text-editing .sample-title.is-text-edit-target .selection-handle,
.editor-shell.is-text-editing .sample-title.is-text-edit-target .rotation-handle {
  display: none;
}

.editor-shell.is-text-editing .sample-title.is-text-edit-target .sample-title-text {
  min-width: 8px;
  display: inline-block;
  outline: none;
  cursor: text;
}

.editor-shell.is-text-editing .sample-title.is-text-edit-target .text-edit-caret {
  position: absolute;
  top: .75cqw;
  bottom: .75cqw;
  left: 62%;
  width: 1px;
  display: block;
  background: #245fae;
  animation: text-edit-caret-blink 1s step-end infinite;
}

.editor-shell.has-text-overflow-demo .sample-title.is-text-edit-target .text-overflow-indicator {
  position: absolute;
  right: -13px;
  bottom: -13px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ba3a43;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(30, 35, 43, .18);
}

.editor-shell.is-text-editing .editor-toolbar-context > span::after {
  content: " / テキスト編集";
}

@keyframes text-edit-caret-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

/* A3-03 material review states */
.product-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.product-detail-heading > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.material-source-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e6eeff;
  color: #245fae;
  font-size: 8px;
  font-weight: 700;
}

.material-panel-note {
  margin: 0 0 10px;
  color: #747d88;
  font-size: 8px;
  line-height: 1.55;
}

.selected-product-context {
  position: relative;
  border: 1px solid #c6d5ef;
  background: #eaf1ff;
}

.selected-product-context::after {
  content: "作業コンテキスト";
  position: absolute;
  top: 8px;
  right: 9px;
  color: #5576a8;
  font-size: 7px;
  font-weight: 700;
}

.asset-panel-body .field > span {
  font-size: 9px;
}

.material-item,
.asset-card {
  transition: border-color .12s ease, background-color .12s ease;
}

.material-item:hover,
.asset-card:hover {
  border-color: #adc0df;
  background: #f7faff;
}

.placed-object.is-provenance-demo {
  outline: 2px solid #2f67b8;
  outline-offset: 2px;
}

.placed-object.is-provenance-demo::after {
  content: "商品から配置";
  position: absolute;
  top: -19px;
  left: -1px;
  padding: 2px 5px;
  border-radius: 4px 4px 0 0;
  background: #2f67b8;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
}

/* A3-04 image editing state */
.image-edit-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #b8caea;
  border-radius: 8px;
  background: #edf3ff;
}

.image-edit-status[hidden],
.image-edit-controls[hidden] {
  display: none !important;
}

.image-edit-status > div {
  display: grid;
  gap: 2px;
}

.image-edit-status strong {
  color: #255b9f;
  font-size: 10px;
}

.image-edit-status span {
  color: #66788f;
  font-size: 8px;
}

.image-edit-status kbd {
  min-width: 34px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #c8d2df;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: #586271;
  font-family: inherit;
  font-size: 8px;
}

.image-edit-controls {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d6dbe2;
}

.image-zoom-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 8px;
}

.image-zoom-row input[type="range"] {
  width: 100%;
}

.image-zoom-row output {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  color: #4d5560;
  font-size: 9px;
}

.image-edit-help {
  margin: 0;
  color: #737b86;
  font-size: 8px;
  line-height: 1.5;
}

.image-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 6px;
}

.image-edit-actions button {
  min-height: 34px;
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #555d68;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.image-edit-actions button.is-primary {
  border-color: #2f67b8;
  background: #2f67b8;
  color: #fff;
}

.sample-image {
  overflow: visible;
}

.sample-image-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: inherit;
}

.sample-image-content::before,
.sample-image-content::after {
  content: "";
  position: absolute;
  border-radius: 24%;
  background: #b8c3d7;
}

.sample-image-content::before {
  width: 44.7cqw;
  height: 20.8cqw;
  left: 26%;
  top: 30%;
  transform: rotate(11deg);
}

.sample-image-content::after {
  width: 19.1cqw;
  height: 38.3cqw;
  left: 38%;
  top: 23%;
  transform: rotate(-18deg);
}

.sample-image-content .sample-image-mark {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.image-crop-overlay {
  display: none;
}

.editor-shell.is-image-editing .sample-image.is-image-edit-target {
  outline: 2px solid #2f67b8;
  outline-offset: 2px;
  cursor: move;
}

.editor-shell.is-image-editing .sample-image.is-image-edit-target .sample-image-content {
  inset: -10% -8% -12% -14%;
  opacity: .92;
}

.editor-shell.is-image-editing .sample-image.is-image-edit-target .image-crop-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: block;
  box-shadow: 0 0 0 100vmax rgba(18, 23, 30, .28);
  pointer-events: none;
}

.crop-grid {
  position: absolute;
  background: rgba(255,255,255,.7);
}

.crop-grid-v1, .crop-grid-v2 {
  top: 0;
  bottom: 0;
  width: 1px;
}

.crop-grid-v1 { left: 33.333%; }
.crop-grid-v2 { left: 66.666%; }

.crop-grid-h1, .crop-grid-h2 {
  left: 0;
  right: 0;
  height: 1px;
}

.crop-grid-h1 { top: 33.333%; }
.crop-grid-h2 { top: 66.666%; }

.crop-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  background: #2f67b8;
}

.crop-nw { left: -5px; top: -5px; }
.crop-ne { right: -5px; top: -5px; }
.crop-se { right: -5px; bottom: -5px; }
.crop-sw { left: -5px; bottom: -5px; }

/* A3-05 / A3-06 object representatives */
.editor-shell[data-object-mode]:not([data-object-mode="text"]) .sample-title.selected-object {
  outline: none;
}

.editor-shell[data-object-mode]:not([data-object-mode="text"]) .sample-title .selection-handle,
.editor-shell[data-object-mode]:not([data-object-mode="text"]) .sample-title .rotation-handle {
  display: none;
}

.sample-shape-demo,
.sample-line-demo,
.sample-table-demo {
  display: none;
}

.editor-shell[data-object-mode="shape"] .sample-shape-demo {
  position: absolute;
  z-index: 4;
  left: 11cqw;
  top: 88cqw;
  width: 25cqw;
  height: 15cqw;
  display: grid;
  place-items: center;
  border: 2px solid #486c9f;
  border-radius: 2cqw;
  background: #dbe7fa;
  color: #264d82;
  font-size: 3.2cqw;
  font-weight: 800;
  outline: 2px solid #2f67b8;
  outline-offset: 3px;
}

.editor-shell[data-object-mode="shape"] .sample-shape-demo::before,
.editor-shell[data-object-mode="shape"] .sample-shape-demo::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #2f67b8;
  background: #fff;
}

.editor-shell[data-object-mode="shape"] .sample-shape-demo::before {
  left: -6px;
  top: -6px;
}

.editor-shell[data-object-mode="shape"] .sample-shape-demo::after {
  right: -6px;
  bottom: -6px;
}

.editor-shell[data-object-mode="line"] .sample-line-demo {
  position: absolute;
  z-index: 4;
  left: 12cqw;
  top: 93cqw;
  width: 48cqw;
  height: 28px;
  display: block;
  outline: 2px solid rgba(47,103,184,.2);
  outline-offset: 4px;
}

.editor-shell[data-object-mode="line"] .sample-line-demo > span {
  position: absolute;
  left: 0;
  right: 12px;
  top: 13px;
  height: 2px;
  background: #2f67b8;
  transform: rotate(-7deg);
  transform-origin: left center;
}

.editor-shell[data-object-mode="line"] .sample-line-demo > span::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 10px solid #2f67b8;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.editor-shell[data-object-mode="line"] .sample-line-demo::before,
.editor-shell[data-object-mode="line"] .sample-line-demo::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border: 1px solid #2f67b8;
  border-radius: 50%;
  background: #fff;
}

.editor-shell[data-object-mode="line"] .sample-line-demo::before {
  left: -5px;
  top: 9px;
}

.editor-shell[data-object-mode="line"] .sample-line-demo::after {
  right: -1px;
  top: 3px;
}

.editor-shell[data-object-mode="table"] .sample-copy {
  display: none;
}

.editor-shell[data-object-mode="table"] .sample-table-demo {
  position: absolute;
  z-index: 4;
  left: 9cqw;
  right: 9cqw;
  top: 86cqw;
  display: grid;
  grid-template-columns: 1.3fr 1fr .8fr;
  border: 2px solid #2f67b8;
  background: #fff;
  outline: 2px solid rgba(47,103,184,.25);
  outline-offset: 3px;
}

.sample-table-demo > div {
  min-height: 7.6cqw;
  display: flex;
  align-items: center;
  padding: 1.2cqw;
  border-right: 1px solid #9299a3;
  border-bottom: 1px solid #9299a3;
  color: #343a43;
  font-size: 2cqw;
}

.sample-table-demo > div:nth-child(-n+3) {
  background: #eef2f7;
  font-weight: 800;
}

.sample-table-demo > div:nth-child(3n) {
  border-right: 0;
}

.sample-table-demo > div:nth-last-child(-n+3) {
  border-bottom: 0;
}

.shape-text-section,
.table-property-group + .table-property-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #d7dce3;
}

.table-property-group {
  display: grid;
  gap: 8px;
}

.table-property-group > strong {
  color: #4a515b;
  font-size: 9px;
}

.table-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.table-action-grid button,
.table-selection-row button,
.table-border-sides button {
  min-height: 30px;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  color: #555d68;
  font-size: 8px;
  cursor: pointer;
}

.table-action-grid button:hover,
.table-selection-row button:hover,
.table-border-sides button:hover {
  background: #eef3f8;
}

.table-selection-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.table-selection-row button.is-active,
.table-border-sides button.is-active {
  border-color: #b7c8e7;
  background: #e5edff;
  color: #245fae;
  font-weight: 700;
}

.table-border-sides {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.table-key-hint {
  margin: 8px 0 0;
  color: #747d88;
  font-size: 8px;
  line-height: 1.6;
}

.table-key-hint kbd {
  padding: 2px 5px;
  border: 1px solid #cfd4db;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: #505864;
  font-family: inherit;
  font-size: 8px;
}

/* A3-07 page / layer review states */
.page-context-menu,
.page-bulk-actions {
  margin-bottom: 10px;
  border: 1px solid #d2d7de;
  border-radius: 8px;
  background: #fff;
}

.page-context-menu[hidden],
.page-bulk-actions[hidden] {
  display: none !important;
}

.page-context-menu {
  display: grid;
  gap: 5px;
  padding: 9px;
  box-shadow: 0 5px 16px rgba(31,37,46,.09);
}

.page-context-menu > div {
  display: grid;
  gap: 1px;
  margin-bottom: 3px;
}

.page-context-menu strong {
  color: #3f4650;
  font-size: 10px;
}

.page-context-menu small {
  color: #818995;
  font-size: 8px;
}

.page-context-menu button {
  min-height: 30px;
  border: 1px solid #d2d7de;
  border-radius: 6px;
  background: #fff;
  color: #555d68;
  font-size: 9px;
  cursor: pointer;
  text-align: left;
  padding-inline: 9px;
}

.page-context-menu button:hover {
  background: #eef3f8;
}

.page-context-menu button:nth-of-type(2) {
  color: #9a3840;
}

.page-context-menu p {
  margin: 4px 0 0;
  padding-top: 7px;
  border-top: 1px solid #eceef2;
  color: #7c8490;
  font-size: 7px;
  line-height: 1.5;
}

.page-bulk-actions {
  display: grid;
  gap: 7px;
  padding: 8px;
  background: #edf3ff;
  border-color: #bfd0ec;
}

.page-bulk-actions strong {
  color: #2a5c9d;
  font-size: 9px;
}

.page-bulk-actions > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.page-bulk-actions button {
  min-height: 28px;
  border: 1px solid #c5d1e3;
  border-radius: 6px;
  background: #fff;
  color: #4f5e72;
  font-size: 8px;
  cursor: pointer;
}

.layer-item.is-locked small {
  color: #8a5b16;
  font-weight: 700;
}

.layer-item.is-hidden-layer {
  opacity: .58;
}

.layer-item.is-hidden-layer strong {
  text-decoration: line-through;
}

.layer-item.is-hidden-layer small {
  color: #8b4650;
  font-weight: 700;
}

/* A3-09 to A3-12 context / preview / business states */
.editor-state-banner[hidden] {
  display: none !important;
}

.editor-shell.has-editor-state-banner {
  grid-template-rows: 60px 42px 58px minmax(0, 1fr);
}

.editor-shell.has-editor-state-banner .editor-toolbar-flyouts {
  top: 160px;
}

.editor-state-banner {
  position: relative;
  z-index: 28;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid #cbd0d8;
  background: #edf3ff;
}

.editor-state-banner > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.editor-state-banner strong {
  flex: 0 0 auto;
  color: #285b9f;
  font-size: 10px;
}

.editor-state-banner span {
  overflow: hidden;
  color: #62738b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-state-banner button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #b6c8e4;
  border-radius: 7px;
  background: #fff;
  color: #245fae;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.editor-state-banner[data-state-type="error"] {
  border-bottom-color: #e0b0b5;
  background: #fff0f1;
}

.editor-state-banner[data-state-type="error"] strong {
  color: #a43742;
}

.editor-state-banner[data-state-type="error"] span {
  color: #805960;
}

.editor-state-banner[data-state-type="locked"] {
  border-bottom-color: #dec58f;
  background: #fff8e7;
}

.editor-state-banner[data-state-type="locked"] strong {
  color: #806018;
}

.editor-state-banner[data-state-type="locked"] span {
  color: #75664a;
}

.editor-context-menu {
  position: absolute;
  z-index: 80;
  width: 230px;
  overflow: hidden;
  border: 1px solid #cfd4db;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(27, 33, 41, .2);
}

.editor-context-menu[hidden] {
  display: none !important;
}

.context-menu-section + .context-menu-section {
  border-top: 1px solid #e5e8ec;
}

.context-menu-section {
  padding: 5px;
}

.context-menu-section[hidden] {
  display: none !important;
}

.context-menu-section button {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #3f4650;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.context-menu-section button:hover {
  background: #eef3f8;
}

.context-menu-section kbd {
  color: #8a929d;
  font-family: inherit;
  font-size: 7px;
  font-weight: 500;
  white-space: nowrap;
}

.preview-page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-page-nav label input {
  width: 48px;
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  font-size: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.editor-history-dialog {
  width: min(760px, calc(100vw - 40px));
}

.pdf-history-list {
  display: grid;
  gap: 8px;
}

.pdf-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #d8dce2;
  border-radius: 8px;
  background: #fff;
}

.pdf-history-row.is-current {
  border-color: #b9cbe9;
  background: #f4f7ff;
}

.pdf-history-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pdf-history-row strong {
  color: #343a43;
  font-size: 12px;
}

.pdf-history-row small {
  color: #7c8490;
  font-size: 9px;
}

.pdf-history-row > span {
  color: #5d6774;
  font-size: 9px;
  text-align: center;
}

.pdf-history-row > div:last-child {
  display: flex;
  gap: 5px;
}

.pdf-history-row button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #cfd4db;
  border-radius: 6px;
  background: #fff;
  color: #4f5864;
  font-size: 8px;
  cursor: pointer;
}

.editor-shell.is-readonly-editor .editor-workspace {
  background: #d5d9de;
}

.editor-shell.is-readonly-editor .editor-toolbar button:disabled,
.editor-shell.is-readonly-editor .left-panel button:disabled,
.editor-shell.is-readonly-editor .property-panel button:disabled,
.editor-shell.is-readonly-editor .property-panel input:disabled,
.editor-shell.is-readonly-editor .property-panel select:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.editor-shell.is-readonly-editor .paper-canvas {
  box-shadow:
    0 1px 1px rgba(30,35,43,.10),
    0 8px 22px rgba(30,35,43,.14);
}

.editor-shell[data-readonly-kind="completed"] .editor-edit-state .status-chip {
  background: #dff2e2;
  color: #256235;
}

.editor-shell[data-readonly-kind="locked"] .editor-edit-state .status-chip {
  background: #fff0c7;
  color: #755a18;
}

/* A3 canvas representative states */
.sample-page-number {
  position: absolute;
  right: 8.5cqw;
  bottom: 7.8cqw;
  min-width: 4.2cqw;
  height: 4.2cqw;
  display: grid;
  place-items: center;
  border: 1px solid #cbd0d8;
  border-radius: 50%;
  background: #fff;
  color: #68717d;
  font-size: 1.7cqw;
  font-weight: 700;
}

.sample-multi-demo,
.sample-group-demo {
  display: none;
}

.editor-shell.is-multi-select-demo .sample-title.selected-object {
  outline: none;
}

.editor-shell.is-multi-select-demo .sample-title .selection-handle,
.editor-shell.is-multi-select-demo .sample-title .rotation-handle {
  display: none;
}

.editor-shell.is-multi-select-demo .sample-multi-demo {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: block;
  pointer-events: none;
}

.multi-object {
  position: absolute;
  border: 2px solid #2f67b8;
  background: rgba(216, 231, 255, .22);
}

.multi-object::before,
.multi-object::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #2f67b8;
  background: #fff;
}

.multi-object::before {
  left: -6px;
  top: -6px;
}

.multi-object::after {
  right: -6px;
  bottom: -6px;
}

.multi-object-a {
  left: 8.8cqw;
  top: 10cqw;
  width: 45cqw;
  height: 12cqw;
}

.multi-object-b {
  left: 55cqw;
  top: 86cqw;
  width: 28cqw;
  height: 17cqw;
}

.smart-guide {
  position: absolute;
  z-index: 2;
  background: #e33b8d;
}

.smart-guide-v {
  top: 5cqw;
  bottom: 22cqw;
  left: 50%;
  width: 1px;
}

.smart-guide-h {
  left: 6cqw;
  right: 6cqw;
  top: 94cqw;
  height: 1px;
}

.editor-shell.is-group-edit-demo .sample-title,
.editor-shell.is-group-edit-demo .sample-image,
.editor-shell.is-group-edit-demo .sample-copy {
  opacity: .32;
}

.editor-shell.is-group-edit-demo .sample-title .selection-handle,
.editor-shell.is-group-edit-demo .sample-title .rotation-handle {
  display: none;
}

.editor-shell.is-group-edit-demo .sample-title.selected-object {
  outline: none;
}

.editor-shell.is-group-edit-demo .sample-group-demo {
  position: absolute;
  z-index: 10;
  left: 12cqw;
  top: 83cqw;
  width: 58cqw;
  height: 28cqw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5cqw;
  padding: 3.5cqw;
  border: 2px dashed #7d4cc4;
  background: rgba(242, 236, 255, .72);
}

.sample-group-demo > strong {
  position: absolute;
  left: 3.5cqw;
  top: -5.7cqw;
  padding: 1cqw 1.8cqw;
  border-radius: 5px;
  background: #7d4cc4;
  color: #fff;
  font-size: 1.8cqw;
}

.group-child {
  display: grid;
  place-items: center;
  border: 2px solid #2f67b8;
  background: #fff;
  color: #48515d;
  font-size: 2cqw;
}

.group-child-image {
  background: #e3e8f0;
}

.group-child-text {
  background: #fff;
}
