/* ==========================================================================
   Shared Unified Toolbar & Visual Slide Controls (Doc Forms Suite)
   ========================================================================== */

html {
  scrollbar-gutter: stable;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  color: #18181b;
  font-size: 12px;
  line-height: 1.35;
  border-bottom: 1px solid #e4e4e7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.toolbar-row {
  max-width: 1460px;
  margin: 0 auto;
  padding: 6px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.toolbar-row-nav {
  background: transparent;
  border-bottom: 1px solid #f4f4f5;
  min-height: 44px;
  flex-wrap: nowrap;
}

.toolbar-row-work {
  background: #fafafa;
  border-top: none;
  padding-top: 6px;
  padding-bottom: 6px;
  min-height: 40px;
}

.toolbar-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.toolbar .nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  text-decoration: none;
  color: #52525b;
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.toolbar .nav-tab:hover {
  background: #f4f4f5;
  color: #18181b;
}

.toolbar .nav-tab.is-active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

.toolbar-output {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.1);
}

.btn-primary:hover {
  background: #27272a;
  border-color: #27272a;
}

.btn-secondary {
  background: #ffffff;
  color: #3f3f46;
  border-color: #e4e4e7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #18181b;
}

.btn-ghost {
  background: transparent;
  color: #52525b;
  border-color: transparent;
}

.btn-ghost:hover {
  background: #f4f4f5;
  border-color: #e4e4e7;
  color: #18181b;
}

.toolbar .btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  line-height: 1.25;
  border-radius: 7px;
  white-space: nowrap;
}

.toolbar .control-item {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: #71717a;
  line-height: 1.3;
  gap: 5px;
  white-space: nowrap;
}

.toolbar .control-item select {
  height: 28px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 220px;
  background: #ffffff;
  color: #18181b;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.toolbar .control-item select:hover,
.toolbar .control-item select:focus {
  border-color: #a1a1aa;
}

.toolbar #projectSelector {
  max-width: 145px;
}

.toolbar #templateSelector {
  max-width: 175px;
}

.toolbar #tplPicker {
  max-width: 210px;
}

.toolbar #cardSelector {
  max-width: 190px;
}

.save-status-pill {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.work-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

@media (max-width: 1240px) {
  .toolbar-row-nav,
  .toolbar-nav,
  .toolbar-output {
    flex-wrap: wrap;
  }
}

.toolbar .subtab-switch {
  display: inline-flex;
  align-items: center;
  height: 28px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.toolbar .subtab-btn {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: #71717a;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.toolbar .subtab-btn:hover {
  color: #18181b;
}

.toolbar .subtab-btn.is-active {
  background: #ffffff;
  color: #18181b;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toolbar .subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #e4e4e7;
  color: #52525b;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toolbar .subtab-btn.is-active .subtab-badge {
  background: #18181b;
  color: #ffffff;
}

.toolbar .joined-actions {
  display: inline-flex;
  align-items: center;
  height: 28px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  padding: 2px 4px;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.joined-label {
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  padding: 0 6px;
  white-space: nowrap;
}

.toolbar .joined-actions .btn {
  min-height: 22px;
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
  border-radius: 5px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #3f3f46;
}

.toolbar .joined-actions .btn:hover {
  background: #f4f4f5;
  color: #18181b;
}

.toolbar .font-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  padding: 2px 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.font-pill-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  white-space: nowrap;
}

.toolbar .font-pill select {
  border: none;
  background: transparent;
  color: #18181b;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  height: 22px;
  padding: 0 4px;
  max-width: 125px;
  cursor: pointer;
  outline: none;
}

.toolbar .font-pill input[type="color"] {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid #d4d4d8;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.toolbar .font-pill input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.toolbar .font-pill input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.toolbar .font-pill .btn-icon-reset {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #71717a;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar .font-pill .btn-icon-reset:hover {
  background: #f4f4f5;
  color: #18181b;
}

.toolbar .toolbar-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  white-space: nowrap;
}

.toolbar-more-wrap {
  position: relative;
  display: inline-flex;
}

.toolbar-more-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 210px;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 24, 27, 0.14);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.more-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: #18181b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.more-menu-item:hover {
  background: #f4f4f5;
}

.more-menu-item.is-danger {
  color: #b91c1c;
}

.more-menu-item.is-danger:hover {
  background: #fef2f2;
}

.more-menu-sep {
  height: 1px;
  background: #e4e4e7;
  margin: 3px 4px;
}

.more-menu-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.more-menu-item:disabled:hover {
  background: transparent;
}

.more-menu-label {
  padding: 4px 10px 2px;
  font-size: 10px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.more-menu-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #3f3f46;
}

.more-menu-field select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #ffffff;
  color: #18181b;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.sd-dropdown-panel {
  min-width: 248px;
}

.sd-style-panel {
  min-width: 286px;
  padding: 8px 6px;
}

.sd-font-pill-vertical {
  margin: 4px 8px 2px;
  padding: 8px 9px !important;
  flex-wrap: wrap;
  gap: 6px !important;
  border-radius: 8px !important;
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
}

.sd-font-pill-vertical select {
  flex: 1 1 150px;
  max-width: none !important;
}

.btn-danger-hover:hover {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

.toolbar .toolbar-hint {
  max-width: 1460px;
  margin: 0 auto;
  min-height: 24px;
  padding: 3px 18px 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.3;
  color: #a1a1aa;
  background: transparent;
  border-top: 1px solid #f4f4f5;
}

/* ==========================================================================
   Visual Slide Controls (One-Click Layout & Segmented Pills)
   ========================================================================== */
.slide-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 5px 10px;
}

.slide-page-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.slide-control-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.slide-control-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #52525b;
  white-space: nowrap;
}

.layout-icon-strip,
.mini-seg {
  display: inline-flex;
  align-items: center;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.page-layout-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #3f3f46;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.page-layout-drop-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.page-layout-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #ffffff;
  color: #18181b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.page-layout-drop-btn:hover:not(:disabled) {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.page-layout-drop-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-layout-drop-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 245px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 260;
}

.page-layout-drop-menu[hidden] {
  display: none !important;
}

.page-layout-drop-head {
  padding: 5px 8px 4px;
  border-bottom: 1px solid #f4f4f5;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #71717a;
}

.page-layout-drop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  color: #3f3f46;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  padding: 6px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.page-layout-drop-item:hover {
  background: #f4f4f5;
  color: #18181b;
}

.page-layout-drop-item.is-active {
  background: #18181b;
  color: #ffffff;
}

.layout-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  color: #52525b;
  cursor: pointer;
  padding: 2px;
}

.layout-icon-btn:hover {
  background: #e4e4e7;
  color: #18181b;
}

.layout-icon-btn.is-active {
  background: #18181b;
  color: #ffffff;
}

.mini-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: #52525b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.mini-seg-btn:hover {
  background: #e4e4e7;
  color: #18181b;
}

.mini-seg-btn.is-active {
  background: #18181b;
  color: #ffffff;
}

.mini-seg-val {
  font-size: 11px;
  font-weight: 700;
  color: #18181b;
  padding: 0 5px;
  min-width: 34px;
  text-align: center;
}

.panel-header .mini-seg {
  background: #ffffff;
  border-color: #d4d4d8;
  padding: 1px;
  gap: 1px;
}

.panel-header .mini-seg-btn {
  font-size: 10px;
  padding: 1px 6px;
}

@media print {
  .toolbar,
  .toolbar-more-menu,
  .slide-top-bar,
  .proj-modal-backdrop {
    display: none !important;
  }

  .rb-project-select,
  .rv-project-select,
  .sr-project-select,
  .rb-header-select,
  .rv-header-select,
  .sr-header-select,
  .sw-project-select,
  .a4-project-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: none !important;
  }
}

.rb-project-select,
.rv-project-select,
.sr-project-select,
.rb-header-select,
.rv-header-select,
.sr-header-select,
.a4-project-select {
  cursor: pointer;
}

.sw-loc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.sw-project-select {
  border: 1px solid #d4d4d8;
  background: #f4f4f5;
  color: #18181b;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 4px;
  cursor: pointer;
  flex: 0 0 auto;
  outline: none;
}

.sw-project-select:hover,
.sw-project-select:focus {
  border-color: #18181b;
  background: #ffffff;
}

/* ==========================================================================
   Project Profiles & Fixed Logo Manager Modal
   ========================================================================== */
.proj-manage-btn {
  padding: 5px 8px;
  font-size: 11.5px;
  white-space: nowrap;
}

.proj-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(24, 24, 27, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.proj-modal {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(24, 24, 27, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Sarabun", "Noto Sans Thai", sans-serif;
}

.proj-modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid #e4e4e7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fafafa;
}

.proj-modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
}

.proj-modal-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: #71717a;
}

.proj-modal-close {
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #18181b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
}

.proj-modal-body {
  padding: 12px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proj-card-wrap {
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.proj-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.proj-archive-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: #fafafa;
  border-top: 1px solid #f0f0f2;
}

.proj-archive-stats {
  font-size: 11px;
  font-weight: 600;
  color: #52525b;
}

.proj-archive-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 3px 8px !important;
  font-size: 10.5px !important;
  border-radius: 6px !important;
}

.proj-card-idx {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #18181b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.proj-logo-drop {
  position: relative;
  width: 96px;
  height: 48px;
  flex: 0 0 auto;
  border: 1.5px dashed #d4d4d8;
  border-radius: 6px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 3px;
}

.proj-logo-drop:hover,
.proj-logo-drop.is-dragover {
  border-color: #18181b;
  background: #f4f4f5;
}

.proj-logo-drop.has-logo {
  border-style: solid;
  background: #ffffff;
}

.proj-logo-drop img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.proj-logo-ph {
  font-size: 10.5px;
  font-weight: 700;
  color: #71717a;
}

.proj-logo-clr {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: none;
  background: rgba(24, 24, 27, 0.8);
  color: #ffffff;
  font-size: 10px;
  line-height: 15px;
  padding: 0;
  cursor: pointer;
}

.proj-fields-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 105px 115px 1fr;
  gap: 8px;
}

.proj-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proj-field span {
  font-size: 10.5px;
  font-weight: 700;
  color: #71717a;
}

.proj-field input {
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #18181b;
  background: #fafafa;
  outline: none;
}

.proj-field input:focus {
  border-color: #18181b;
  background: #ffffff;
}

.proj-del-btn {
  flex: 0 0 auto;
  padding: 5px 9px !important;
  font-size: 11px !important;
}

.proj-modal-foot {
  padding: 12px 18px;
  border-top: 1px solid #e4e4e7;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Compact Document Color Theme Dots & Unified Slide Themes (Minimal / Navy / Forest Green)
   ========================================================================== */
.theme-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 5px;
  margin-left: 3px;
  border-left: 1px solid #e4e4e7;
}

.font-size-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  margin: 0 2px;
  border-left: 1px solid #e4e4e7;
  border-right: 1px solid #e4e4e7;
}

.font-size-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #27272a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
}

.font-size-btn:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.font-size-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.font-size-val {
  font-size: 10.5px;
  font-weight: 700;
  color: #3f3f46;
  min-width: 31px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #d4d4d8;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.theme-dot:hover {
  transform: scale(1.12);
}

.theme-dot[data-doc-theme="minimal"] {
  background: #27272a;
}

.theme-dot[data-doc-theme="navy"] {
  background: #9AAEB5;
}

.theme-dot[data-doc-theme="emerald"] {
  background: #939E7B;
}

.theme-dot[data-doc-theme="sage-smoke"] {
  background: linear-gradient(135deg, #7D8A96 0%, #A4B3A4 55%, #C8D1CC 100%);
}

.theme-dot[data-doc-theme="earth-ivory"] {
  background: linear-gradient(135deg, #7A7463 0%, #8A5A4A 50%, #C49A6C 100%);
}

.theme-dot.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1.5px #18181b;
}

html[data-theme="sage-smoke"] {
  --accent: #5d6974;
  --ink: #242b30;
  --ink-muted: #5a6568;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --surface-tint: #f4f6f4;
  --surface-head: #e6ebe7;
  --slate-banner: #6c7a86;
  --ice-blue: #f4f6f4;
  --steel-blue: #e6ebe7;
}

html[data-theme="earth-ivory"] {
  --accent: #7A7463;
  --ink: #2e2620;
  --ink-muted: #6a5f53;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --surface-tint: #F5EFE6;
  --surface-head: #ede3d6;
  --slate-banner: #7A7463;
  --ice-blue: #F5EFE6;
  --steel-blue: #ede3d6;
}

html[data-theme="sage-smoke"] .rb-banner,
html[data-theme="sage-smoke"] .rv-banner,
html[data-theme="sage-smoke"] .sr-banner,
html[data-theme="sage-smoke"] .mock-banner,
html[data-theme="sage-smoke"] .issue-code-pill {
  background: linear-gradient(90deg, #626e79 0%, #7D8A96 54%, #A4B3A4 100%);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html[data-theme="earth-ivory"] .rb-banner,
html[data-theme="earth-ivory"] .rv-banner,
html[data-theme="earth-ivory"] .sr-banner,
html[data-theme="earth-ivory"] .mock-banner,
html[data-theme="earth-ivory"] .issue-code-pill {
  background: linear-gradient(90deg, #7A7463 0%, #8A5A4A 60%, #C49A6C 100%);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html[data-theme="sage-smoke"] .rb-panel-head,
html[data-theme="sage-smoke"] .panel-header,
html[data-theme="sage-smoke"] .mode-b-card-head,
html[data-theme="sage-smoke"] .rb-comment-table th,
html[data-theme="sage-smoke"] .compare-table thead th,
html[data-theme="sage-smoke"] .mock-box-head,
html[data-theme="sage-smoke"] .rv-notes-head {
  background: #e6ebe7;
  color: #364147;
}

html[data-theme="earth-ivory"] .rb-panel-head,
html[data-theme="earth-ivory"] .panel-header,
html[data-theme="earth-ivory"] .mode-b-card-head,
html[data-theme="earth-ivory"] .rb-comment-table th,
html[data-theme="earth-ivory"] .compare-table thead th,
html[data-theme="earth-ivory"] .mock-box-head,
html[data-theme="earth-ivory"] .rv-notes-head {
  background: #ede3d6;
  color: #4d3b32;
}

html[data-theme="sage-smoke"] .mode-d-box-title,
html[data-theme="sage-smoke"] .rb-tbl-num {
  color: #5d6974;
}

html[data-theme="earth-ivory"] .mode-d-box-title,
html[data-theme="earth-ivory"] .rb-tbl-num {
  color: #7A7463;
}

html[data-theme="emerald"] {
  --accent: #5b6545;
  --ink: #22271b;
  --ink-muted: #58604a;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --surface-tint: #f3f5ee;
  --surface-head: #e7ece0;
  --slate-banner: #939E7B;
  --ice-blue: #f3f5ee;
  --steel-blue: #e7ece0;
}

html[data-theme="navy"] {
  --accent: #4f646c;
  --ink: #1d2629;
  --ink-muted: #55666d;
  --line: #e4e4e7;
  --line-dark: #d4d4d8;
  --surface-tint: #eef2f4;
  --surface-head: #e4eaed;
  --slate-banner: #9AAEB5;
  --ice-blue: #eef2f4;
  --steel-blue: #e4eaed;
}

html[data-theme="emerald"] .rb-banner,
html[data-theme="emerald"] .rv-banner,
html[data-theme="emerald"] .sr-banner,
html[data-theme="emerald"] .mock-banner,
html[data-theme="emerald"] .issue-code-pill {
  background: linear-gradient(90deg, #838e6c 0%, #939E7B 58%, #aab496 100%);
  color: #1d2317;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html[data-theme="emerald"] .rb-topic-input,
html[data-theme="emerald"] .rv-topic-input,
html[data-theme="emerald"] .sr-topic-input,
html[data-theme="emerald"] .issue-code-pill .pill-input {
  color: #1d2317;
}

html[data-theme="emerald"] .rb-topic-input::placeholder,
html[data-theme="emerald"] .rv-topic-input::placeholder,
html[data-theme="emerald"] .sr-topic-input::placeholder {
  color: rgba(29, 35, 23, 0.55);
}


html[data-theme="navy"] .rb-banner,
html[data-theme="navy"] .rv-banner,
html[data-theme="navy"] .sr-banner,
html[data-theme="navy"] .mock-banner,
html[data-theme="navy"] .issue-code-pill {
  background: linear-gradient(90deg, #8b9fa7 0%, #9AAEB5 58%, #b2c3c9 100%);
  color: #1b2428;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html[data-theme="navy"] .rb-topic-input,
html[data-theme="navy"] .rv-topic-input,
html[data-theme="navy"] .sr-topic-input,
html[data-theme="navy"] .issue-code-pill .pill-input {
  color: #1b2428;
}

html[data-theme="navy"] .rb-topic-input::placeholder,
html[data-theme="navy"] .rv-topic-input::placeholder,
html[data-theme="navy"] .sr-topic-input::placeholder {
  color: rgba(27, 36, 40, 0.55);
}


html[data-theme="navy"] .rb-panel-head,
html[data-theme="navy"] .panel-header,
html[data-theme="navy"] .mode-b-card-head,
html[data-theme="navy"] .rb-comment-table th,
html[data-theme="navy"] .compare-table thead th,
html[data-theme="navy"] .mock-box-head,
html[data-theme="navy"] .rv-notes-head {
  background: #e4eaed;
  color: #1b2428;
}

html[data-theme="navy"] .mode-d-box-title,
html[data-theme="navy"] .rb-tbl-num {
  color: #4f646c;
}

html[data-theme="emerald"] .rb-panel-head,
html[data-theme="emerald"] .panel-header,
html[data-theme="emerald"] .mode-b-card-head,
html[data-theme="emerald"] .rb-comment-table th,
html[data-theme="emerald"] .compare-table thead th,
html[data-theme="emerald"] .mock-box-head,
html[data-theme="emerald"] .rv-notes-head {
  background: #e7ece0;
  color: #1d2317;
}

html[data-theme="emerald"] .mode-d-box-title,
html[data-theme="emerald"] .rb-tbl-num {
  color: #5b6545;
}

/* Standard Detail Theme Overrides */
html[data-theme="sage-smoke"] .sd-banner-pill,
html[data-theme="sage-smoke"] .sd-tb-sheet,
html[data-theme="sage-smoke"] .sd-callout-num,
html[data-theme="sage-smoke"] .sd3-code-input,
html[data-theme="sage-smoke"] .sd-pin {
  background: linear-gradient(90deg, #626e79 0%, #7D8A96 54%, #A4B3A4 100%);
  color: #ffffff;
}

html[data-theme="earth-ivory"] .sd-banner-pill,
html[data-theme="earth-ivory"] .sd-tb-sheet,
html[data-theme="earth-ivory"] .sd-callout-num,
html[data-theme="earth-ivory"] .sd3-code-input,
html[data-theme="earth-ivory"] .sd-pin {
  background: linear-gradient(90deg, #7A7463 0%, #8A5A4A 60%, #C49A6C 100%);
  color: #ffffff;
}

html[data-theme="navy"] .sd-banner-pill,
html[data-theme="navy"] .sd-tb-sheet,
html[data-theme="navy"] .sd-callout-num,
html[data-theme="navy"] .sd3-code-input,
html[data-theme="navy"] .sd-pin {
  background: linear-gradient(90deg, #8b9fa7 0%, #9AAEB5 58%, #b2c3c9 100%);
  color: #1b2428;
}

html[data-theme="emerald"] .sd-banner-pill,
html[data-theme="emerald"] .sd-tb-sheet,
html[data-theme="emerald"] .sd-callout-num,
html[data-theme="emerald"] .sd3-code-input,
html[data-theme="emerald"] .sd-pin {
  background: linear-gradient(90deg, #838e6c 0%, #939E7B 58%, #aab496 100%);
  color: #1d2317;
}

/* Shared Slide Indicator Actions & Undo Button */
.toolbar .btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.slide-ind-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.slide-ind-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.slide-ind-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  background: #ffffff;
  color: #52525b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.slide-ind-btn:hover:not(:disabled) {
  background: #f4f4f5;
  border-color: #a1a1aa;
  color: #18181b;
}

.slide-ind-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slide-ind-btn.is-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

@media print {
  .slide-ind-actions,
  .no-print {
    display: none !important;
  }
}

@media (max-width: 1180px) {
  .toolbar-row-nav {
    flex-wrap: wrap;
  }
  .toolbar-nav {
    flex-wrap: wrap;
  }
}

/* Built-in Photo Annotator Modal */
.anno-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(24, 24, 27, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.anno-backdrop[hidden] {
  display: none !important;
}

.anno-dialog {
  width: min(980px, 96vw);
  max-height: 94vh;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Sarabun", "Noto Sans Thai", sans-serif;
  color: #18181b;
}

.anno-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e4e4e7;
  background: #fafafa;
}

.anno-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.anno-close {
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #52525b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.anno-close:hover {
  background: #f4f4f5;
  color: #18181b;
}

.anno-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #e4e4e7;
  background: #ffffff;
}

.anno-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #f4f4f5;
}

.anno-tool-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #52525b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.anno-tool-btn:hover {
  background: #ffffff;
  color: #18181b;
}

.anno-tool-btn.is-active {
  background: #18181b;
  color: #ffffff;
}

.anno-color-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #a1a1aa;
  cursor: pointer;
  padding: 0;
}

.anno-color-btn.is-active {
  box-shadow: 0 0 0 2px #18181b;
  transform: scale(1.1);
}

.anno-text-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 12px;
}

.anno-text-bar[hidden] {
  display: none !important;
}

.anno-text-bar input {
  flex: 1;
  min-width: 180px;
  height: 28px;
  padding: 3px 9px;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12.5px;
}

.anno-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 260px;
  max-height: calc(94vh - 155px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: #27272a;
}

.anno-canvas {
  max-width: 100%;
  max-height: calc(94vh - 185px);
  display: block;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  cursor: crosshair;
  touch-action: none;
}

.anno-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #e4e4e7;
  background: #fafafa;
}

.anno-hint {
  font-size: 11.5px;
  color: #71717a;
}

.anno-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Engineering Document Approval Stamp Overlay (Print + SVG/PNG Export) */
.a4-sheet,
.pc-sheet {
  position: relative;
}

.doc-stamp-overlay {
  position: absolute;
  top: 94px;
  right: 24px;
  z-index: 25;
  pointer-events: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  padding: 5px 14px;
  border: 2.5px solid #15803d;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #15803d;
  text-align: center;
  transform: rotate(-7deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0.9;
}

.doc-stamp-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
}

.doc-stamp-sub {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.88;
  white-space: nowrap;
}

.doc-stamp-overlay[data-stamp-tone="warn"] {
  border-color: #b45309;
  color: #b45309;
}

.doc-stamp-overlay[data-stamp-tone="danger"] {
  border-color: #b91c1c;
  color: #b91c1c;
}

.doc-stamp-overlay[data-stamp-tone="muted"] {
  border-color: #52525b;
  color: #52525b;
}

@media print {
  .doc-stamp-overlay {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.has-suite-sidebar {
    padding-left: 0 !important;
  }
  .suite-sidebar,
  .suite-sb-reopen,
  .suite-topbar-title {
    display: none !important;
  }
}

/* ==========================================================================
   Global Left Workspace Sidebar (Shared Across All Form & Index Pages)
   ========================================================================== */
body.has-suite-sidebar {
  padding-left: 264px;
  transition: padding-left 0.18s ease;
}

body.has-suite-sidebar.suite-sidebar-collapsed {
  padding-left: 0;
}

.suite-sidebar {
  position: fixed;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: 242px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px 8px;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.04);
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", sans-serif;
  color: #18181b;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

body.suite-sidebar-collapsed .suite-sidebar {
  transform: translateX(-270px);
  opacity: 0;
  pointer-events: none;
}

.suite-sidebar a {
  color: inherit;
  text-decoration: none;
}

.suite-sidebar .sb-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suite-sidebar .sb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
}

.suite-sidebar .sb-brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #18181b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.suite-sidebar .sb-brand-text {
  flex: 1;
  min-width: 0;
}

.suite-sidebar .sb-brand-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.suite-sidebar .sb-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
}

.suite-sidebar .sb-pro-pill {
  padding: 1px 5px;
  border-radius: 999px;
  background: #18181b;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.suite-sidebar .sb-brand-sub {
  display: block;
  font-size: 10.5px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suite-sidebar .sb-icon-btn {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.suite-sidebar .sb-icon-btn:hover {
  background: #ffffff;
  border-color: #e4e4e7;
  color: #18181b;
}

.suite-sidebar .sb-search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
}

.suite-sidebar .sb-search-box:focus-within {
  border-color: #18181b;
}

.suite-sidebar .sb-search-ico {
  color: #71717a;
  flex-shrink: 0;
}

.suite-sidebar .sb-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 11.5px;
  color: #18181b;
}

.suite-sidebar .sb-kbd {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #71717a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.suite-sidebar .sb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 2px;
}

.suite-sidebar .sb-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.suite-sidebar .sb-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.suite-sidebar .sb-group-lbl {
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.suite-sidebar .sb-group-head .sb-group-lbl {
  padding: 0;
}

.suite-sidebar .sb-mini-action {
  border: none;
  background: transparent;
  color: #71717a;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 5px;
}

.suite-sidebar .sb-mini-action:hover {
  background: #ffffff;
  color: #18181b;
}

.suite-sidebar .sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suite-sidebar .sb-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5.5px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #52525b;
  border: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.suite-sidebar .sb-nav-item:hover {
  background: #f0f0f2;
  color: #18181b;
}

.suite-sidebar .sb-nav-item.is-active {
  background: #ececef;
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-nav-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.suite-sidebar .sb-nav-item svg {
  color: #71717a;
  flex-shrink: 0;
}

.suite-sidebar .sb-nav-item.is-active svg {
  color: #18181b;
}

.suite-sidebar .sb-count {
  min-width: 14px;
  padding: 0 2px;
  background: transparent;
  color: #a1a1aa;
  font-size: 10.5px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.suite-sidebar .sb-nav-item.is-active .sb-count {
  background: transparent;
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-badge-a3 {
  padding: 0 5px;
  border-radius: 4px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #71717a;
  font-size: 9px;
  font-weight: 600;
}

.suite-sidebar .sb-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suite-sidebar .sb-nav-parent {
  width: 100%;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.suite-sidebar .sb-nav-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.suite-sidebar .sb-nav-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  transition: transform 0.14s ease, color 0.14s ease;
}

.suite-sidebar .sb-nav-group.is-expanded .sb-nav-chev {
  transform: rotate(90deg);
  color: #18181b;
}

.suite-sidebar .sb-nav-sub {
  margin-left: 12px;
  padding: 2px 0 3px 9px;
  border-left: 1px solid #d4d4d8;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.suite-sidebar .sb-nav-sub[hidden] {
  display: none;
}

.suite-sidebar .sb-nav-sub-lbl {
  padding: 4px 8px 1px;
  font-size: 9.5px;
  font-weight: 700;
  color: #a1a1aa;
  letter-spacing: 0.02em;
}

.suite-sidebar .sb-nav-sub-item {
  display: flex;
  align-items: center;
  padding: 4.5px 8px;
  border-radius: 6px;
  font-size: 11.2px;
  font-weight: 500;
  color: #52525b;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.suite-sidebar .sb-nav-sub-item:hover {
  background: #f0f0f2;
  color: #18181b;
}

.suite-sidebar .sb-nav-sub-item.is-active {
  background: #ececef;
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-divider {
  height: 1px;
  background: #ececef;
  margin: 2px 6px;
}

.suite-sidebar .sb-project-select-wrap {
  padding: 2px 4px 3px;
}

.suite-sidebar .sb-project-select {
  width: 100%;
  height: 28px;
  padding: 2px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
  color: #18181b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  outline: none;
}

.suite-sidebar .sb-proj-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suite-sidebar .sb-proj-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.suite-sidebar .sb-proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: 7px;
  padding-right: 4px;
  transition: background-color 0.12s ease;
}

.suite-sidebar .sb-proj-row:hover {
  background: #f0f0f2;
}

.suite-sidebar .sb-proj-row.is-active {
  background: #ececef;
}

.suite-sidebar .sb-proj-row .sb-proj-item {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5.5px 4px 5.5px 8px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.suite-sidebar .sb-proj-row.is-active .sb-proj-item {
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-proj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 5.5px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #52525b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.suite-sidebar .sb-proj-item:hover {
  background: #f0f0f2;
  color: #18181b;
}

.suite-sidebar .sb-proj-item.is-active {
  background: #ececef;
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-proj-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.suite-sidebar .sb-proj-ico {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  flex-shrink: 0;
}

.suite-sidebar .sb-proj-dot {
  width: 7px;
  height: 7px;
  margin: 0 3.5px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.suite-sidebar .sb-proj-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suite-sidebar .sb-proj-right {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.suite-sidebar .sb-proj-num {
  font-size: 10.5px;
  font-weight: 500;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
  padding-right: 2px;
}

.suite-sidebar .sb-proj-row.is-active .sb-proj-num,
.suite-sidebar .sb-proj-item.is-active .sb-proj-num {
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-proj-chev {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.14s ease, color 0.12s ease, background-color 0.12s ease;
}

.suite-sidebar .sb-proj-chev:hover {
  background: rgba(24, 24, 27, 0.06);
  color: #18181b;
}

.suite-sidebar .sb-proj-wrap.is-expanded .sb-proj-chev svg {
  transform: rotate(90deg);
}

.suite-sidebar .sb-proj-sub {
  margin-left: 11px;
  padding: 1px 0 2px 9px;
  border-left: 1px solid #e4e4e7;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.suite-sidebar .sb-proj-sub-archive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.suite-sidebar .sb-proj-sub-archive:hover {
  background: #f0f0f2;
  color: #18181b;
}

.suite-sidebar .sb-proj-sub-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suite-sidebar .sb-proj-sub-left svg {
  color: #a1a1aa;
  flex-shrink: 0;
}

.suite-sidebar .sb-proj-sub-archive:hover .sb-proj-sub-left svg {
  color: #52525b;
}

.suite-sidebar .sb-proj-sub-num {
  font-size: 10.5px;
  font-weight: 500;
  color: #b4b4bb;
  font-variant-numeric: tabular-nums;
}

.suite-sidebar .sb-proj-sub-num.has-items {
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .sb-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #ececef;
}

.suite-sidebar .storage-card {
  padding: 4px 6px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suite-sidebar .storage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
}

.suite-sidebar .storage-title {
  font-weight: 600;
  color: #71717a;
}

.suite-sidebar .storage-text {
  color: #71717a;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.suite-sidebar .storage-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #e4e4e7;
  overflow: hidden;
}

.suite-sidebar .storage-fill {
  height: 100%;
  border-radius: 999px;
  background: #71717a;
  transition: width 0.25s ease;
}

.suite-sidebar .storage-fill.is-warn {
  background: #d97706;
}

.suite-sidebar .storage-compact-btn {
  width: auto;
  height: auto;
  margin-top: 0;
  padding: 1px 5px;
  border: 1px solid #e4e4e7;
  border-radius: 4px;
  background: #ffffff;
  color: #52525b;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.suite-sidebar .storage-compact-btn:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #18181b;
}

.suite-sidebar .storage-compact-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.suite-sidebar .storage-fill.is-danger {
  background: #dc2626;
}

.suite-sidebar .sb-footer-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid #e4e4e7;
  background: transparent;
  font-size: 10.5px;
  font-weight: 500;
  color: #71717a;
}

.suite-sidebar .sb-footer-btn:hover {
  background: #ffffff;
  color: #18181b;
}

.suite-sidebar .disk-sync-card {
  padding: 6px 7px;
  border: 1px solid #ececef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suite-sidebar .disk-sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.suite-sidebar .disk-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #52525b;
}

.suite-sidebar .disk-sync-status {
  font-size: 9.5px;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suite-sidebar .disk-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.suite-sidebar .disk-btn {
  flex: 1 1 auto;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #52525b;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.suite-sidebar .disk-btn:hover {
  background: #f4f4f5;
  color: #18181b;
}

.suite-sidebar .disk-btn.is-primary {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #18181b;
  font-weight: 600;
}

.suite-sidebar .disk-btn.is-primary:hover {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
}

.suite-sidebar .disk-btn:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.suite-sidebar .disk-btn.is-primary {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
}

.suite-sb-reopen {
  display: none;
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 135;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #d4d4d8;
  background: #18181b;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(24, 24, 27, 0.22);
  cursor: pointer;
}

body.has-suite-sidebar.suite-sidebar-collapsed .suite-sb-reopen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.suite-topbar-title {
  display: none;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
}

.suite-topbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #18181b;
}

body.has-suite-sidebar:not(.suite-sidebar-collapsed) .toolbar-nav {
  display: none;
}

body.has-suite-sidebar:not(.suite-sidebar-collapsed) .suite-topbar-title {
  display: inline-flex;
}

@media (max-width: 1020px) {
  body.has-suite-sidebar {
    padding-left: 0;
  }
  body.has-suite-sidebar .toolbar-nav {
    display: flex !important;
  }
  body.has-suite-sidebar .suite-topbar-title {
    display: none !important;
  }
  body.has-suite-sidebar:not(.suite-sidebar-collapsed) .suite-sb-reopen {
    display: none;
  }
}

/* ==========================================================================
   Archive & Lock Banner + Locked Read-Only State
   ========================================================================== */
.doc-lock-banner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 10px;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  font-size: 12.5px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.doc-lock-banner[hidden] {
  display: none !important;
}

.doc-lock-banner.is-unlocked {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.doc-lock-msg {
  line-height: 1.4;
}

.doc-lock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.12);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.subtab-btn.is-active .subtab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

body.doc-is-locked .sheet-paper input,
body.doc-is-locked .sheet-paper textarea,
body.doc-is-locked .sheet-paper select,
body.doc-is-locked .sheet-paper [contenteditable],
body.doc-is-locked .sheet-paper button:not(.allow-when-locked),
body.doc-is-locked .slide-frame input,
body.doc-is-locked .slide-frame textarea,
body.doc-is-locked .slide-frame select,
body.doc-is-locked .slide-frame button:not(.allow-when-locked),
body.doc-is-locked .slide-frame .sr-photo-slot,
body.doc-is-locked .slide-frame .photo-slot,
body.doc-is-locked .sd-sheet input,
body.doc-is-locked .sd-sheet textarea,
body.doc-is-locked .sd-sheet select,
body.doc-is-locked .sd-sheet button:not(.allow-when-locked),
body.doc-is-locked .sd-sheet .sd-slot,
body.doc-is-locked .pc-sheet input,
body.doc-is-locked .pc-sheet textarea,
body.doc-is-locked .pc-sheet select,
body.doc-is-locked .pc-sheet button:not(.allow-when-locked),
body.doc-is-locked .pc-sheet .mx-photo-slot,
body.doc-is-locked .col-resizer-h,
body.doc-is-locked .col-resizer-v,
body.doc-is-locked .sol-resizer-b,
body.doc-is-locked .sol-resizer-bl,
body.doc-is-locked .cmp-col-resizer,
body.doc-is-locked .owner-col-resizer,
body.doc-is-locked .sw-col-resizer,
body.doc-is-locked .mode-c-resizer,
body.doc-is-locked .rv-notes-resizer,
body.doc-is-locked .slide-controls button:not(.allow-when-locked),
body.doc-is-locked .slide-controls input,
body.doc-is-locked .slide-controls select {
  pointer-events: none !important;
  cursor: not-allowed;
}

body.doc-is-locked .col-resizer-h,
body.doc-is-locked .col-resizer-v,
body.doc-is-locked .sol-resizer-b,
body.doc-is-locked .sol-resizer-bl,
body.doc-is-locked .cmp-col-resizer,
body.doc-is-locked .owner-col-resizer,
body.doc-is-locked .sw-col-resizer,
body.doc-is-locked .mode-c-resizer,
body.doc-is-locked .slide-logo-clear,
body.doc-is-locked .logo-clear {
  opacity: 0 !important;
}

body.doc-is-locked .sheet-paper,
body.doc-is-locked .slide-frame,
body.doc-is-locked .sd-sheet,
body.doc-is-locked .pc-sheet {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45), 0 10px 28px rgba(24, 24, 27, 0.08);
}

/* Schedule Trigger & Modal across all forms */
.doc-sched-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #52525b;
}

.doc-sched-btn.is-set {
  background: #f4f4f5;
  border-color: #e4e4e7;
  color: #18181b;
  font-weight: 600;
}

.doc-sched-btn.is-overdue {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.suite-sched-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(24, 24, 27, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.suite-sched-backdrop[hidden] {
  display: none !important;
}

.suite-sched-modal {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(24, 24, 27, 0.16);
  overflow: hidden;
  font-family: "Noto Sans Thai", "Sarabun", sans-serif;
}

.suite-sched-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f2;
}

.suite-sched-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #18181b;
}

.suite-sched-sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: #71717a;
}

.suite-sched-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.suite-sched-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suite-sched-lbl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: #3f3f46;
}

.suite-sched-mini {
  border: 1px solid #e4e4e7;
  background: #fafafa;
  color: #18181b;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
}

.suite-sched-dur {
  font-size: 10.5px;
  font-weight: 600;
  color: #71717a;
}

.suite-sched-inp {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d4d4d8;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12.5px;
  color: #18181b;
  outline: none;
}

.suite-sched-inp:focus {
  border-color: #18181b;
}

.suite-sched-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.suite-sched-preset-lbl {
  font-size: 11px;
  color: #71717a;
  margin-right: 2px;
}

.suite-sched-preset {
  border: 1px solid #e4e4e7;
  background: #fafafa;
  color: #3f3f46;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.suite-sched-preset:hover {
  background: #f4f4f5;
  color: #18181b;
}

.suite-sched-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #f0f0f2;
  background: #fafafa;
}

.suite-sched-foot-r {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Template 000 / Unsaved Draft Status & Faint Background Watermark
   ========================================================================== */
.draft-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.draft-status-pill[hidden] {
  display: none !important;
}

.btn.is-draft-save {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
  font-weight: 700;
}

.btn.is-draft-save:hover {
  background: #27272a;
  border-color: #27272a;
  color: #ffffff;
}

body.doc-is-draft .sheet-paper,
body.doc-is-draft .slide-frame,
body.doc-is-draft .sd-sheet,
body.doc-is-draft .pc-sheet {
  position: relative;
}

body.doc-is-draft .sheet-paper::after,
body.doc-is-draft .slide-frame::after,
body.doc-is-draft .sd-sheet::after,
body.doc-is-draft .pc-sheet::after {
  content: "DRAFT";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 112px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(24, 24, 27, 0.055);
  transform: rotate(-28deg);
  pointer-events: none;
  user-select: none;
  z-index: 6;
}

/* ==========================================================================
   Project Pill Tab Bar (replaces plain dropdown cleanly across toolbars)
   ========================================================================== */
.proj-select-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.proj-tab-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  height: 28px;
  padding: 2px;
  border-radius: 8px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.proj-tab-bar::-webkit-scrollbar {
  display: none;
}

.proj-tab-pill {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: #71717a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.proj-tab-pill:hover {
  color: #18181b;
  background: rgba(255, 255, 255, 0.7);
}

.proj-tab-pill.is-active {
  background: #ffffff;
  color: #18181b;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   Continuous Sortable Archive Stream Panel (🔒 จัดเก็บ)
   ========================================================================== */
.doc-archive-stream {
  max-width: 1120px;
  margin: 2px auto 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 12px;
}

.doc-archive-stream[hidden] {
  display: none !important;
}

.das-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 2px 0;
}

.das-title {
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.das-count-badge {
  background: #18181b;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.das-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.das-seg {
  display: inline-flex;
  background: #e4e4e7;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.das-seg-btn {
  border: none;
  background: transparent;
  color: #52525b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.das-seg-btn.is-active {
  background: #ffffff;
  color: #18181b;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

.das-search-inp,
.das-sort-sel {
  height: 27px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #ffffff;
  color: #18181b;
  font-family: inherit;
  font-size: 11.5px;
  padding: 2px 8px;
}

.das-search-inp {
  width: 170px;
}

.das-table-wrap {
  max-height: 290px;
  overflow-y: auto;
}

.das-table {
  width: 100%;
  border-collapse: collapse;
}

.das-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f4f5;
  color: #3f3f46;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #d4d4d8;
  white-space: nowrap;
}

.das-th-sort {
  cursor: pointer;
  user-select: none;
}

.das-th-sort:hover {
  background: #e4e4e7 !important;
  color: #18181b;
}

.das-sort-arrow {
  font-size: 9.5px;
  margin-left: 3px;
  opacity: 0.7;
}

.das-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid #f4f4f5;
  color: #27272a;
  font-size: 11.5px;
  vertical-align: middle;
}

.das-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.das-row:hover {
  background: #fafafa;
}

.das-row.is-active {
  background: #eff6ff;
}

.das-row.is-active td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

.das-code-pill {
  font-weight: 700;
  color: #18181b;
  font-variant-numeric: tabular-nums;
}

.das-proj-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #3f3f46;
  white-space: nowrap;
}

.das-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.das-act-btn {
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #18181b;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.das-act-btn:hover {
  background: #f4f4f5;
}

.das-act-btn.is-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.doc-stream-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.doc-stream-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  margin: 18px auto 4px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-left: 3px solid #2563eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  font-family: "Noto Sans Thai", "Inter", system-ui, sans-serif;
  font-size: 11.5px;
}

.doc-stream-divider.is-active {
  border-color: #93c5fd;
  border-left-color: #1d4ed8;
  background: #eff6ff;
}

.doc-stream-div-left {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.doc-stream-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #18181b;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
}

.doc-stream-title {
  color: #27272a;
  font-weight: 600;
}

.doc-stream-div-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-stream-lock-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: #52525b;
  margin-right: 4px;
}

.doc-archive-pages-host {
  margin-top: 0;
  padding-top: 0;
}

.doc-stream-group.is-locked .sheet-paper,
.doc-stream-group.is-locked .slide-frame,
.doc-stream-group.is-locked .sd-sheet,
.doc-stream-group.is-locked .pc-sheet {
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45), 0 10px 28px rgba(24, 24, 27, 0.08);
}

.doc-stream-group.is-unlocked input,
.doc-stream-group.is-unlocked textarea,
.doc-stream-group.is-unlocked select,
.doc-stream-group.is-unlocked button,
.doc-stream-group.is-unlocked .sr-photo-slot,
.doc-stream-group.is-unlocked .photo-slot,
.doc-stream-group.is-unlocked .sd-slot,
.doc-stream-group.is-unlocked .mx-photo-slot {
  pointer-events: auto !important;
  cursor: auto;
}

@media print {
  .proj-tab-bar,
  .doc-archive-stream,
  .doc-stream-divider {
    display: none !important;
  }
}

/* ==========================================================================
   Send-to-Summary / Home Action Button (outside document in toolbar)
   ========================================================================== */
.btn.is-send-ready {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}

.btn.is-send-ready:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn.is-sent {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
  font-weight: 600;
}

.btn.is-sent:hover {
  background: #dcfce7;
  border-color: #86efac;
}

/* ==========================================================================
   Closed Project Badges & Filter (Projects Modal, Tab Bar, Summary)
   ========================================================================== */
.proj-status-pill,
.sum-closed-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.proj-status-pill.is-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.proj-status-pill.is-closed,
.sum-closed-badge {
  background: #f4f4f5;
  color: #52525b;
  border: 1px solid #d4d4d8;
}

.proj-item.is-closed {
  opacity: 0.85;
  background: #fafafa;
}

.sum-closed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #52525b;
  cursor: pointer;
  user-select: none;
}

.sum-closed-toggle input[type="checkbox"] {
  accent-color: #18181b;
  cursor: pointer;
}

.sum-proj-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sum-proj-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #27272a;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}

.sum-proj-pill:hover {
  border-color: #a1a1aa;
  background: #fafafa;
}

.sum-proj-pill.is-selected {
  border-color: #18181b;
  background: #18181b;
  color: #ffffff;
}

.sum-proj-pill.is-selected .sum-proj-cnt {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.sum-proj-pill.is-closed-proj {
  border-style: dashed;
  color: #52525b;
}

.sum-proj-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #3f3f46;
  font-size: 10.5px;
  font-weight: 700;
}

/* Google Drive Cloud Sync Modal & Sidebar Pill */
.suite-sidebar .disk-drive-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 9.5px;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suite-sidebar .disk-btn.is-drive {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.suite-sidebar .disk-btn.is-drive:hover {
  background: #dbeafe;
  color: #1e40af;
}

.drive-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.drive-modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  color: #18181b;
}

.drive-modal-dialog .proj-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #ececef;
}

.drive-modal-dialog .proj-modal-header h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.drive-modal-dialog .proj-modal-close {
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #52525b;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}

.drive-modal-dialog .proj-modal-close:hover {
  background: #f4f4f5;
  color: #18181b;
}

.drive-modal-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drive-field-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drive-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46;
}

.drive-field input,
.drive-admin-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #d4d4d8;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12.5px;
  color: #18181b;
  background: #ffffff;
}

.drive-auth-box {
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.drive-auth-row,
.drive-sync-actions,
.drive-admin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.drive-admin-row input {
  flex: 1 1 180px;
}

.drive-modal-dialog .disk-btn {
  flex: 0 1 auto;
  padding: 6px 11px;
  font-size: 12px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #27272a;
  font-family: inherit;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
}

.drive-modal-dialog .disk-btn.is-primary {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
  font-weight: 600;
}

.drive-modal-dialog .disk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.drive-gis-host {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.drive-user-status {
  font-size: 12px;
  color: #3f3f46;
  line-height: 1.5;
}

.drive-role-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11px;
  font-weight: 600;
}

.drive-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.drive-progress-track {
  height: 8px;
  width: 100%;
  background: #e4e4e7;
  border-radius: 999px;
  overflow: hidden;
}

.drive-progress-fill {
  height: 100%;
  background: #2563eb;
  transition: width 0.2s ease;
}

.drive-progress-text {
  font-size: 11.5px;
  color: #52525b;
}

.drive-modal-overlay[hidden],
.drive-admin-row[hidden],
.drive-gis-host[hidden],
.drive-progress-wrap[hidden],
.drive-error-box[hidden],
.doc-preview-warn-banner[hidden],
.doc-hidden-bar[hidden] {
  display: none !important;
}

.drive-error-box {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
}

/* Template Preview Warning & Hidden Work Summary Bars */
.doc-preview-warn-banner,
.doc-hidden-bar {
  max-width: 1120px;
  margin: 0 auto 10px;
  padding: 7px 12px;
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.doc-preview-warn-banner {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.doc-preview-dirty {
  color: #b45309;
  font-weight: 600;
}

.doc-hidden-bar {
  border: 1px solid #e4e4e7;
  background: #f8fafc;
  color: #3f3f46;
}

.doc-hidden-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.doc-hidden-all-pill {
  padding: 1px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
}

.doc-hidden-actions,
.doc-preview-warn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}



