@font-face {
  font-family: "Ubuntu";
  src: url("fonts/Ubuntu-Regular.ttf?v=54460") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: "Ubuntu";
  src: url("fonts/Ubuntu-Bold.ttf?v=54460") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: block;
}

:root {
  color-scheme: dark;
  --bg: #111317;
  --panel: #191c21;
  --panel-2: #21252b;
  --border: #30353d;
  --text: #f3f5f7;
  --muted: #9da5af;
  --accent: #3979ee;
  --accent-hover: #4d88f1;
  --warning: #f2c05c;
  --success: #4dc98b;
  --danger: #ff716f;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-version {
  color: var(--muted);
  font-size: 0.48em;
  font-weight: 600;
  vertical-align: super;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-width: 920px;
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 19, 23, 0.94);
  backdrop-filter: blur(18px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 4px;
  color: #79a7ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-account-button.is-online {
  border-color: rgba(77, 201, 139, 0.5);
}

.server-account-button.is-offline {
  border-color: rgba(255, 113, 111, 0.45);
  color: var(--danger);
}

.project-save-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 88px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.project-save-status[hidden] {
  display: none;
}

.project-save-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(77, 201, 139, 0.12);
}

.project-save-status.is-dirty .project-save-status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(242, 192, 92, 0.12);
}

.project-save-status.is-saving .project-save-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 121, 238, 0.14);
  animation: save-status-pulse 900ms ease-in-out infinite alternate;
}

.project-save-status.is-error {
  color: var(--danger);
}

.project-save-status.is-error .project-save-status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 113, 111, 0.12);
}

@keyframes save-status-pulse {
  to {
    opacity: 0.42;
  }
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.button-primary {
  background: var(--accent);
}

.button-primary:not(:disabled):hover {
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--border);
  background: var(--panel-2);
}

.workspace {
  display: grid;
  height: calc(100vh - 76px);
  grid-template-columns: minmax(250px, 300px) minmax(650px, 1fr);
}

.editor-panel {
  overflow: auto;
  padding: 20px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.intro-card,
.notice,
.diagnostics,
.document-info {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}

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

.page-size-item {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 20, 25, 0.56);
  font-size: 12px;
}

.page-size-item strong {
  color: var(--text);
}

.page-size-item span {
  color: var(--muted);
  line-height: 1.4;
}

.page-size-item .page-size-net {
  color: #b8d0ff;
  font-weight: 700;
}

.muted {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

code {
  color: #b8d0ff;
}

.notice {
  color: #e8d4a6;
  font-size: 13px;
  line-height: 1.45;
}

.notice p {
  margin-top: 4px;
}

.notice-warning {
  border-color: rgba(242, 192, 92, 0.35);
  background: rgba(242, 192, 92, 0.08);
}

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

.counter {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.field-list {
  display: grid;
  gap: 10px;
}

.editing-hint {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.editing-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.editing-summary span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(121, 167, 255, 0.1);
  color: #a9c4ff;
  font-size: 11px;
  font-weight: 750;
}

.price-actions {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(57, 121, 238, 0.42);
  border-radius: var(--radius);
  background: rgba(57, 121, 238, 0.06);
}

.price-actions[hidden] {
  display: none;
}

.price-action-field {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.price-action-field select,
.price-action-field input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--panel-2);
  color: var(--text);
}

.price-action-field select:focus,
.price-action-field input:focus {
  border-color: var(--accent);
}

.price-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.price-action-buttons button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.price-action-buttons button:hover {
  border-color: var(--accent);
  background: rgba(57, 121, 238, 0.18);
}

.price-action-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.empty-state {
  padding: 32px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.diagnostics ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.diagnostics li + li {
  margin-top: 5px;
}

.preview-panel {
  min-width: 0;
  background: #0c0e11;
}

.preview-toolbar {
  display: flex;
  height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: #16191d;
}

.preview-page-heading {
  min-width: 82px;
}

.preview-page-heading strong {
  display: block;
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-actions {
  display: flex;
  align-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}

.page-actions[hidden] {
  display: none;
}

.page-actions > span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.page-actions button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.page-actions button[hidden] {
  display: none;
}

.page-actions button:hover {
  background: var(--accent);
  color: white;
}

.page-actions button.is-danger:hover {
  background: var(--danger);
}

.page-actions button:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-actions button:disabled:hover {
  background: transparent;
  color: var(--text);
}

.zoom-control {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}

.zoom-control button {
  width: 34px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.zoom-control span {
  min-width: 58px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.selection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 5px 11px;
  border: 1px solid rgba(57, 121, 238, 0.5);
  border-radius: 10px;
  background: rgba(57, 121, 238, 0.1);
}

.selection-toolbar[hidden] {
  display: none;
}

.selection-toolbar > span {
  color: #a9c4ff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.selection-object-actions,
.selection-layer-actions,
.selection-align-actions {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.selection-align-actions[hidden] {
  display: none;
}

.selection-object-actions button,
.selection-layer-actions button,
.selection-align-actions button {
  display: grid;
  width: 31px;
  height: 29px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.selection-object-actions button:last-child,
.selection-layer-actions button:last-child,
.selection-align-actions button:last-child {
  border-right: 0;
}

.selection-object-actions button:hover,
.selection-layer-actions button:hover,
.selection-align-actions button:hover {
  background: var(--accent);
  color: white;
}

.selection-object-actions button:disabled,
.selection-layer-actions button:disabled,
.selection-align-actions button:disabled {
  opacity: 0.38;
  cursor: default;
}

.selection-object-actions button:disabled:hover,
.selection-layer-actions button:disabled:hover,
.selection-align-actions button:disabled:hover {
  background: var(--panel-2);
  color: var(--muted);
}

.selection-object-actions button[data-object-action="delete"]:hover {
  background: var(--danger);
}

.selection-object-actions button[data-object-action="delete"]:disabled:hover {
  background: var(--panel-2);
}

.selection-object-actions svg,
.selection-layer-actions svg,
.selection-align-actions svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}

.preview-scroll {
  overflow: auto;
  height: calc(100vh - 138px);
  padding: 36px;
}

.pages {
  display: grid;
  justify-items: center;
  gap: 34px;
  min-width: max-content;
}

.page-shell {
  position: relative;
  overflow: hidden;
  background: white;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.page-shell.is-active-page {
  box-shadow:
    0 0 0 2px rgba(57, 121, 238, 0.9),
    0 20px 70px rgba(0, 0, 0, 0.42);
}

.page-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.field-overlay {
  position: absolute;
  z-index: 41;
  overflow: hidden;
  color: black;
  pointer-events: auto;
  cursor: pointer;
}

.field-overlay::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1px dashed transparent;
  content: "";
  pointer-events: none;
  transition: 120ms ease;
}

.field-overlay:hover::after,
.field-overlay:focus-visible::after,
.field-overlay.is-being-edited::after,
.field-overlay.is-selected::after {
  border-color: rgba(57, 121, 238, 0.95);
  background: rgba(57, 121, 238, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.field-overlay.is-selected::after {
  border-style: solid;
  border-color: rgba(57, 121, 238, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.smart-guide {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: #ff3bbd;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.85);
}

.smart-guide-x {
  top: 0;
  bottom: 0;
  width: 1px;
}

.smart-guide-y {
  right: 0;
  left: 0;
  height: 1px;
}

.smart-guide-page {
  background: #6ba5ff;
}

.field-overlay:focus {
  outline: none;
}

.field-overlay-text {
  display: block;
  line-height: 1;
}

.field-overlay-text.is-being-edited {
  cursor: move;
  touch-action: none;
  user-select: none;
}

.field-overlay-image.is-being-edited {
  cursor: move;
  touch-action: none;
  user-select: none;
}

.field-overlay-image.is-crop-mode {
  cursor: grab;
}

.field-overlay-image.is-crop-mode:active {
  cursor: grabbing;
}

.field-overlay-content {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.field-overlay-table.is-being-edited {
  cursor: move;
  touch-action: none;
  user-select: none;
}

.field-table-content {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  overflow: hidden;
  pointer-events: none;
}

.field-table-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.field-table-cell-text {
  min-width: 0;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.field-text-line {
  width: 100%;
  overflow: hidden;
  white-space: pre;
}

.field-text-column {
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
}

.field-text-line.is-justified {
  display: flex;
  justify-content: space-between;
}

.field-overlay.is-overflow::before {
  position: absolute;
  z-index: 6;
  right: 2px;
  bottom: 2px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  content: "!";
  font: 800 11px/1 Inter, sans-serif;
  pointer-events: none;
}

.frame-handle {
  position: absolute;
  z-index: 5;
  display: none;
  width: 8px;
  height: 8px;
  border: 1px solid #3979ee;
  border-radius: 2px;
  background: white;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
  touch-action: none;
}

.field-overlay.is-being-edited .frame-handle {
  display: block;
}

.field-overlay-table .frame-handle-n,
.field-overlay-table .frame-handle-e,
.field-overlay-table .frame-handle-s,
.field-overlay-table .frame-handle-w {
  display: none;
}

.frame-handle-nw,
.frame-handle-n,
.frame-handle-ne {
  top: 0;
}

.frame-handle-sw,
.frame-handle-s,
.frame-handle-se {
  bottom: 0;
}

.frame-handle-nw,
.frame-handle-w,
.frame-handle-sw {
  left: 0;
}

.frame-handle-ne,
.frame-handle-e,
.frame-handle-se {
  right: 0;
}

.frame-handle-n,
.frame-handle-s {
  left: calc(50% - 4px);
}

.frame-handle-w,
.frame-handle-e {
  top: calc(50% - 4px);
}

.frame-handle-nw,
.frame-handle-se {
  cursor: nwse-resize;
}

.frame-handle-ne,
.frame-handle-sw {
  cursor: nesw-resize;
}

.frame-handle-n,
.frame-handle-s {
  cursor: ns-resize;
}

.frame-handle-w,
.frame-handle-e {
  cursor: ew-resize;
}

.field-overlay-image img {
  z-index: 1;
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

.field-overlay-image.is-crop-mode::after {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(57, 121, 238, 0.95),
    inset 0 0 0 999px rgba(57, 121, 238, 0.04);
}

.field-overlay-image.is-crop-mode .frame-handle {
  display: none;
}

.image-resolution-badge {
  position: absolute;
  z-index: 4;
  right: 4px;
  bottom: 4px;
  display: none;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(17, 20, 25, 0.88);
  color: white;
  font: 800 9px/1.1 Inter, sans-serif;
  pointer-events: none;
}

.field-overlay-image.is-being-edited .image-resolution-badge,
.field-overlay-image.is-low-print-resolution .image-resolution-badge,
.field-overlay-image.is-low-screen-resolution .image-resolution-badge {
  display: block;
}

.field-overlay-image.is-low-print-resolution .image-resolution-badge {
  background: rgba(196, 124, 0, 0.94);
}

.field-overlay-image.is-low-screen-resolution .image-resolution-badge {
  background: rgba(190, 46, 45, 0.95);
}

.field-overlay.is-missing {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 113, 111, 0.85);
  background: rgba(255, 113, 111, 0.12);
  color: #a42b2a;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.preview-placeholder {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding-top: 50px;
  color: var(--muted);
  font-size: 13px;
}

.placeholder-page {
  width: 280px;
  height: 396px;
  border: 1px solid #282c33;
  background: #181b20;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: 460px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #242932;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(255, 113, 111, 0.45);
  color: #ffaaa8;
}

.field-editor-dismiss-layer {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: transparent;
}

.field-editor-dismiss-layer[hidden] {
  display: none;
}

.field-editor {
  position: fixed;
  z-index: 45;
  width: min(380px, calc(100vw - 28px));
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 16px;
  border: 1px solid #414957;
  border-radius: 14px;
  background: rgba(30, 34, 40, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.field-editor.is-table-editor {
  width: min(620px, calc(100vw - 28px));
}

.field-editor[hidden] {
  display: none;
}

.export-dialog-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(10px);
}

.export-dialog-backdrop[hidden] {
  display: none;
}

.projects-dialog-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(12px);
}

.projects-dialog-backdrop[hidden] {
  display: none;
}

.projects-dialog-backdrop.is-open {
  display: grid;
}

.projects-dialog {
  display: grid;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid #414957;
  border-radius: 18px;
  background: #1e2228;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68);
}

.login-dialog {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(430px, calc(100vw - 32px));
  gap: 18px;
  padding: 24px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.login-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 121, 238, 0.16);
}

.login-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.projects-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.projects-dialog-header h2 {
  font-size: 21px;
}

.projects-dialog-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.projects-browser {
  display: grid;
  min-height: 460px;
  grid-template-columns: minmax(260px, 0.82fr) minmax(390px, 1.18fr);
  overflow: hidden;
}

.projects-list-pane,
.project-details {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.projects-list-pane {
  border-right: 1px solid var(--border);
  background: #191c21;
}

.projects-search input,
.project-rename-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: #111419;
  color: var(--text);
}

.projects-search input:focus,
.project-rename-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 121, 238, 0.16);
}

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

.project-list-group-title {
  margin: 8px 2px 0;
  color: #79a7ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.project-list-item:hover {
  border-color: #4a5360;
}

.project-list-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  background: rgba(57, 121, 238, 0.12);
}

.project-list-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-item .project-location-badge {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid #465164;
  border-radius: 999px;
  background: rgba(57, 121, 238, 0.12);
  color: #9fc0ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-list-item span,
.project-list-item time {
  color: var(--muted);
  font-size: 11px;
}

.projects-empty,
.project-details-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.project-details-content {
  display: grid;
  gap: 18px;
}

.project-details-heading {
  display: grid;
  gap: 6px;
}

.remote-project-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.project-client-field {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.project-client-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.project-details-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.project-details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-details-actions .button {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 12px;
}

.button-danger {
  border-color: rgba(255, 113, 111, 0.42);
  background: rgba(255, 113, 111, 0.08);
  color: #ff9b99;
}

.project-versions {
  display: grid;
  gap: 9px;
}

.project-versions-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-versions-heading span {
  color: var(--muted);
  font-size: 11px;
}

.project-version-list {
  display: grid;
  max-height: 280px;
  overflow: auto;
  gap: 7px;
}

.project-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 20, 25, 0.58);
}

.project-version-item > div {
  display: grid;
  gap: 3px;
}

.project-version-item span,
.project-version-item time {
  color: var(--muted);
  font-size: 10px;
}

.project-version-item button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.project-storage-note {
  padding: 10px 12px;
  border: 1px solid rgba(121, 167, 255, 0.26);
  border-radius: 10px;
  background: rgba(57, 121, 238, 0.08);
  color: #b8d0ff;
  font-size: 11px;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 1120px) {
  .project-save-status {
    display: none;
  }
}

@media (max-width: 760px) {
  .projects-browser {
    grid-template-columns: 1fr;
  }

  .projects-list-pane {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.export-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #414957;
  border-radius: 18px;
  background: #1e2228;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
}

.export-dialog-header,
.export-dialog-actions,
.export-pages-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.export-dialog-header {
  margin-bottom: 20px;
}

.export-format-options {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.export-format-options legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.export-format-card,
.export-separate-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
  cursor: pointer;
}

.export-format-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.export-format-card input,
.export-separate-row input,
.export-page-option input {
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.export-format-card span,
.export-separate-row span {
  display: grid;
  gap: 3px;
}

.export-format-card small,
.export-separate-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.export-pages-section {
  margin-top: 18px;
}

.export-pages-heading {
  margin-bottom: 9px;
}

.export-pages-heading > span {
  display: flex;
  gap: 8px;
  color: var(--muted);
}

.export-pages-heading button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9fc0ff;
  cursor: pointer;
}

.export-page-list {
  display: grid;
  max-height: 176px;
  overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #171a1f;
}

.export-page-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.export-page-option:has(input:checked) {
  border-color: rgba(57, 121, 238, 0.7);
}

.export-separate-row {
  margin-top: 16px;
}

.export-separate-row[hidden] {
  display: none;
}

.export-dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.field-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-editor-header {
  margin-bottom: 14px;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.field-editor-body input[type="text"],
.field-editor-body input[type="number"],
.field-editor-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #454d59;
  border-radius: 9px;
  outline: none;
  background: #111419;
  color: var(--text);
}

.rotation-control,
.image-transform-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}

.rotation-control-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.rotation-control-actions,
.image-flip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rotation-control-actions button,
.image-flip-actions button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #15181d;
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.rotation-control-actions button:hover,
.image-flip-actions button:hover,
.image-flip-actions button.is-active {
  border-color: var(--accent);
  background: rgba(57, 121, 238, 0.15);
}

.field-editor-body .rotation-control-actions input[type="number"] {
  width: 68px;
  margin-left: auto;
}

.rotation-control-unit {
  color: var(--muted);
  font-size: 12px;
}

.image-transform-controls {
  gap: 10px;
}

.image-flip-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-editor-body input[type="text"] {
  height: 42px;
}

.field-editor-body input[type="number"] {
  width: 72px;
  height: 36px;
  padding: 7px 8px;
}

.field-editor-body textarea {
  min-height: 150px;
  line-height: 1.45;
  resize: vertical;
}

.field-editor-body input:focus,
.field-editor-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 121, 238, 0.18);
}

.field-editor-file {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px dashed #4a5360;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.table-cell-editor {
  display: grid;
  gap: 6px;
  max-width: 100%;
  max-height: 330px;
  overflow: auto;
  padding: 2px;
}

.table-cell-editor-item {
  display: grid;
  min-width: 76px;
  gap: 4px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: 100ms ease;
}

.table-cell-editor-item.is-selected {
  border-color: var(--accent);
  background: rgba(57, 121, 238, 0.13);
  box-shadow: 0 0 0 2px rgba(57, 121, 238, 0.1);
}

.table-cell-editor-item > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.field-editor-body .table-cell-editor textarea {
  min-height: 58px;
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.3;
  resize: both;
}

.table-editor-root {
  display: grid;
  gap: 10px;
}

.table-structure-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.table-structure-toolbar button {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.table-structure-toolbar button:hover {
  border-color: #566172;
  color: var(--text);
}

.table-selection-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.table-data-type-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.75fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
}

.table-data-type-control span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.table-data-type-control select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #15181d;
  color: var(--text);
}

.table-cell-type-badge {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(57, 121, 238, 0.18);
  color: #a9c4ff;
  font-size: 8px;
}

.table-color-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.table-color-controls > .is-wide {
  grid-column: 1 / -1;
}

.table-color-caption {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.table-border-weight {
  display: grid;
  grid-template-columns: 1fr 72px auto;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.field-editor-body .table-border-weight input[type="number"] {
  width: 72px;
}

.field-editor-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.field-editor-controls {
  display: grid;
  gap: 12px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.image-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.image-mode-switch button,
.image-fit-actions button {
  min-height: 36px;
  border: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.image-mode-switch button + button {
  border-left: 1px solid var(--border);
}

.image-mode-switch button.is-active {
  background: var(--accent);
  color: white;
}

.image-zoom-control {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.image-zoom-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.image-zoom-control strong {
  color: #a9c4ff;
}

.image-zoom-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.image-fit-actions button {
  border: 1px solid var(--border);
  border-radius: 9px;
}

.image-fit-actions button:hover {
  border-color: #4b5563;
  color: var(--text);
}

.field-editor-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-editor-size > span:first-child {
  margin-right: auto;
  color: var(--text);
}

.field-editor-align {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.align-button {
  display: grid;
  height: 36px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.align-button svg {
  width: 25px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.65;
}

.align-button:last-child {
  border-right: 0;
}

.align-button.is-active {
  background: var(--accent);
  color: white;
}

.field-editor-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.field-editor-metric {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.field-editor-metric > span:first-child {
  grid-column: 1 / -1;
}

.field-editor-metric input[type="number"] {
  width: 100%;
}

.field-editor-metric-unit {
  align-self: center;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.field-editor-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.field-editor-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.field-editor-checkbox:has(input:disabled) {
  color: var(--muted);
}

.field-editor-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.field-editor-status-row [data-overflow-status] {
  color: var(--success);
  font-weight: 800;
  text-align: right;
}

.field-editor-status-row [data-overflow-status].is-error {
  color: var(--danger);
}

.field-editor-status-row [data-image-status] {
  text-align: right;
}

.field-editor-status-row [data-image-status].is-error {
  color: var(--danger);
  font-weight: 800;
}

.field-editor-frame-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.field-editor-fit-height,
.field-editor-text-action,
.field-editor-reset {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.field-editor-fit-height,
.field-editor-text-action {
  border-color: rgba(57, 121, 238, 0.48);
  background: rgba(57, 121, 238, 0.1);
  color: #a9c4ff;
}

.field-editor-fit-height:hover,
.field-editor-text-action:hover,
.field-editor-reset:hover {
  border-color: #4b5563;
  color: var(--text);
}
.approved-color-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 14, 20, 0.28);
}

.approved-color-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.approved-color-header small {
  color: var(--muted);
  font-size: 11px;
}

.approved-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
}

.approved-color-swatch {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.approved-color-swatch:hover {
  border-color: rgba(108, 160, 255, 0.7);
}

.approved-color-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: rgba(67, 126, 237, 0.14);
}

.approved-color-sample {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
}

.approved-color-sample.is-none {
  background:
    linear-gradient(135deg, transparent 44%, #ef5c67 45%, #ef5c67 55%, transparent 56%),
    #fff;
}

.approved-color-name {
  overflow: hidden;
  display: -webkit-box;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.approved-color-badge {
  color: #f4cf81;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
