@import url("fonts.css");

:root {
  color-scheme: light;
  --page-bg: #fafafa;
  --bg: #f4efe6;
  --bg-2: #e7d9c5;
  --ink: #3D3D3D;
  --muted: #6c5f52;
  --accent: #c07a2a;
  --accent-2: #3f6b56;
  --card: #fffaf2;
  --stroke: rgba(42, 34, 28, 0.15);
  --shadow: 0 18px 50px rgba(42, 34, 28, 0.18);
  --panel-bg: #f4efe6;
  --panel-elevated: #fffaf2;
  --menu-sub-bg: #ffffff;
  --text-primary: #3d3d3d;
  --text-secondary: #6c5f52;
  --border-subtle: rgba(42, 34, 28, 0.12);
  --border-soft: rgba(42, 34, 28, 0.08);
  --hover-bg: rgba(42, 34, 28, 0.04);
  --field-bg: #ffffff;
  --field-border: rgba(42, 34, 28, 0.18);
  --table-head-bg: #f8f5f0;
  --table-row-bg: #fffaf2;
  --btn-ghost-ink: #4b5563;
  --cta-border-color: rgba(42, 34, 28, 0.5);
  --danger-accent: #dc2626;
  --btn-disabled-bg: #c9c2b6;
  --btn-disabled-ink: #ffffff;
  --btn-disabled-border: #c9c2b6;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #161616;
  --bg: #1e1e1e;
  --bg-2: #2a2a2a;
  --ink: #ececec;
  --muted: #b5b5b5;
  --accent: #d1913f;
  --accent-2: #5f8f78;
  --card: #242424;
  --stroke: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --panel-bg: #1b1f26;
  --panel-elevated: #1d222a;
  --menu-sub-bg: #171a1f;
  --text-primary: #e6ebf2;
  --text-secondary: #b8c0cb;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.1);
  --hover-bg: rgba(255, 255, 255, 0.08);
  --field-bg: #1f242c;
  --field-border: rgba(255, 255, 255, 0.18);
  --table-head-bg: #242a33;
  --table-row-bg: #1d222a;
  --btn-ghost-ink: #dbe2ec;
  --cta-border-color: rgba(255, 255, 255, 0.5);
  --danger-accent: #d07a7a;
  --btn-disabled-bg: #343943;
  --btn-disabled-ink: #9ea7b4;
  --btn-disabled-border: #343943;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .page-bg,
html[data-theme="dark"] .dashboard {
  background: var(--page-bg);
  color: var(--ink);
}

html[data-theme="dark"] header,
html[data-theme="dark"] .side-menu,
html[data-theme="dark"] .side-menu-profile,
html[data-theme="dark"] .side-menu-footer,
html[data-theme="dark"] .history-panel,
html[data-theme="dark"] .rag-qa-panel {
  background: var(--bg);
  border-color: var(--stroke);
}

html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .menu-sub-item,
html[data-theme="dark"] .menu-sub,
html[data-theme="dark"] .menu-status,
html[data-theme="dark"] .menu-version,
html[data-theme="dark"] .menu-user-time {
  border-color: var(--stroke);
  color: var(--muted);
}

html[data-theme="dark"] .menu-item:hover,
html[data-theme="dark"] .menu-sub-item a:hover,
html[data-theme="dark"] .menu-item.active:not(summary),
html[data-theme="dark"] .menu-sub-item.active a {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .timeline,
html[data-theme="dark"] .home-tool,
html[data-theme="dark"] .prompt-card,
html[data-theme="dark"] .prompt-mini-card,
html[data-theme="dark"] .canvas-output,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .account-panel,
html[data-theme="dark"] .inventory-panel,
html[data-theme="dark"] .inventory-kpi,
html[data-theme="dark"] .inventory-table-wrap,
html[data-theme="dark"] .rag-table-wrap,
html[data-theme="dark"] .rag-folder-dialog {
  background: transparent;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .logout-btn,
html[data-theme="dark"] .inventory-btn,
html[data-theme="dark"] .rag-action-btn,
html[data-theme="dark"] .theme-card,
html[data-theme="dark"] .pill-tab,
html[data-theme="dark"] .ai-tab,
html[data-theme="dark"] .account-tab,
html[data-theme="dark"] .dropdown-trigger {
  background: #2a2a2a;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .btn.secondary:hover,
html[data-theme="dark"] .logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .inventory-btn:not(.primary):not(:disabled):hover,
html[data-theme="dark"] .logout-btn:hover:not(:disabled),
html[data-theme="dark"] .attendance-action-trigger:hover:not(:disabled),
html[data-theme="dark"] .inventory-action-trigger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .language-switcher-btn {
  color: #c2c9d4;
}

html[data-theme="dark"] .language-switcher-btn.is-active {
  color: #f3b34d;
}

html[data-theme="dark"] .language-switcher-divider {
  color: rgba(255, 255, 255, 0.24);
}

html[data-theme="dark"] .pull-refresh-pill {
  background: rgba(29, 34, 42, 0.94);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .pull-refresh-spinner {
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
}

html[data-theme="dark"] .btn:not(:disabled):hover {
  filter: brightness(1.08);
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn.cta,
html[data-theme="dark"] .inventory-btn.primary,
html[data-theme="dark"] .assistant-send.is-ready,
html[data-theme="dark"] .assistant-send.is-sending {
  color: #fff;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .account-search,
html[data-theme="dark"] .account-sort,
html[data-theme="dark"] .assistant-input,
html[data-theme="dark"] .inventory-input-row input,
html[data-theme="dark"] .dropdown-search {
  background: #222;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] input:hover:not(:disabled):not([readonly]),
html[data-theme="dark"] select:hover:not(:disabled),
html[data-theme="dark"] textarea:hover:not(:disabled):not([readonly]),
html[data-theme="dark"] .account-search:hover,
html[data-theme="dark"] .account-sort:hover,
html[data-theme="dark"] .assistant-input:hover,
html[data-theme="dark"] .inventory-input-row input:hover,
html[data-theme="dark"] .dropdown-search:hover,
html[data-theme="dark"] .dropdown-trigger:hover:not(:disabled) {
  background: #252b34;
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}

html[data-theme="dark"] .account-table,
html[data-theme="dark"] .inventory-table,
html[data-theme="dark"] .rag-table,
html[data-theme="dark"] .assistant-table {
  color: var(--ink);
}

html[data-theme="dark"] .account-table th,
html[data-theme="dark"] .account-table td,
html[data-theme="dark"] .inventory-table th,
html[data-theme="dark"] .inventory-table td,
html[data-theme="dark"] .rag-table th,
html[data-theme="dark"] .rag-table td,
html[data-theme="dark"] .assistant-table th,
html[data-theme="dark"] .assistant-table td {
  border-color: var(--stroke);
}

html[data-theme="dark"] .account-table th,
html[data-theme="dark"] .inventory-table th,
html[data-theme="dark"] .rag-table th,
html[data-theme="dark"] .assistant-table th {
  background: #262626;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .rag-folder-dialog-list,
html[data-theme="dark"] .account-sort-dropdown .dropdown-menu,
html[data-theme="dark"] .home-tool-menu,
html[data-theme="dark"] .prompt-dialog-menu {
  background: #242424;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .home-tool-menu-item,
html[data-theme="dark"] .prompt-dialog-menu-item {
  color: var(--ink);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .home-tool-menu-item:hover,
html[data-theme="dark"] .prompt-dialog-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] dialog,
html[data-theme="dark"] .account-dialog-inner,
html[data-theme="dark"] .prompt-dialog-inner,
html[data-theme="dark"] .inventory-move-inner {
  background: #202020;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .account-dialog,
html[data-theme="dark"] .prompt-dialog,
html[data-theme="dark"] .inventory-move-dialog {
  background: transparent;
}

html[data-theme="dark"] .account-dialog::backdrop,
html[data-theme="dark"] .prompt-dialog::backdrop,
html[data-theme="dark"] .inventory-move-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .history-panel-header,
html[data-theme="dark"] .prompt-dialog-header,
html[data-theme="dark"] .inventory-move-header,
html[data-theme="dark"] .inventory-move-tabs {
  border-color: var(--stroke);
}

html[data-theme="dark"] .login-card {
  background: var(--panel-elevated);
  border-color: var(--stroke);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .login-brand,
html[data-theme="dark"] .login-subtitle,
html[data-theme="dark"] .login-form label,
html[data-theme="dark"] .login-forgot {
  color: var(--text-secondary);
}

html[data-theme="dark"] .login-form input {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text-primary);
}

html[data-theme="dark"] .login-form input::placeholder {
  color: #8f99a8;
}

html[data-theme="dark"] .login-form input:focus {
  outline-color: rgba(95, 143, 120, 0.45);
  border-color: rgba(95, 143, 120, 0.75);
}

html[data-theme="dark"] .login-error {
  background: rgba(140, 54, 41, 0.25);
  border-color: rgba(180, 79, 62, 0.55);
  color: #ffd6cd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Metropolis", "Noto Sans TC", sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
  color: #496F4B;
}

h3 {
  font-size: 1.2rem;
  font-family: "Noto Sans TC", "Metropolis", sans-serif !important;
}

.hero h3,
.hero.hero-plain h3,
.section-card h3,
.mascot-summary h3,
.card h3 {
  font-family: "Noto Sans TC", "Metropolis", sans-serif !important;
}

h4 {
  font-size: 1rem;
}

p {
  font-size: 0.75rem;
}

.footnote {
  font-size: 0.8rem;
}

h1,
h2,
h3,
h4,
p {
  margin-block-start: 0;
  margin-block-end: 0;
}

h1,
h2,
h3,
h4 {
  font-family: "Metropolis", "Noto Sans TC", sans-serif;
}

h1,
h2,
h3,
h4,
p,
span {
  font-family: "Metropolis", "Noto Sans TC", sans-serif !important;
}

.brand-name h2,
.font-links h2 {
  font-family: "Noto Serif CJK TC", "Noto Serif TC", "Noto Sans TC", serif !important;
}

h1 {
  font-family: "Noto Sans TC", "Metropolis", sans-serif;
}

h4 {
  font-family: "Noto Sans TC", "Metropolis", sans-serif;
}

.shell {
  display: block;
}

.page-bg {
  background: var(--page-bg);
  min-height: 100vh;
  position: relative;
  inset: 0;
  overflow: visible;
}

body.dialog-open .page-bg {
  overflow: visible;
}

body {
  overflow-y: auto;
}

html.no-scroll,
body.home-page.no-scroll {
  overflow: visible;
  height: 100%;
  position: fixed;
  width: 100%;
  inset: 0;
  touch-action: none;
}

body.home-page.no-scroll .page-bg {
  height: 100%;
  overflow: hidden;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  backdrop-filter: none;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--stroke);
  padding: 12px;
  width: 100%;
  font-family: "Noto Sans TC", "Metropolis", sans-serif;
}

@media (min-width: 1281px) {
  header {
    left: 260px;
    right: auto;
    width: calc(100dvw - 260px);
    padding: 8px 16px;
  }

  .brand-link {
    display: none;
  }

  .brand {
    gap: 0;
    flex: 0 0 auto;
  }

  .header-user-meta {
    display: grid;
    gap: 2px;
    margin-left: auto;
  }

  .header-actions {
    margin-left: 0;
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.header-user-meta {
  display: none;
  text-align: right;
}

.header-user-name,
.header-user-role {
  margin: 0;
}

.header-user-name {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.header-user-role {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.2;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: conic-gradient(from 120deg, #c07a2a, #f0c27a, #3f6b56, #c07a2a);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 10px 20px rgba(42, 34, 28, 0.25);
}

.brand h1,
.brand h3 {
  margin: 0;
  letter-spacing: 1px;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (min-width: 1281px) {
  .header-icon-btn {
    border: 1px solid rgba(42, 34, 28, 0.12);
  }

  .header-icon-btn:hover {
    background: rgba(42, 34, 28, 0.06);
  }
}

.header-icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink);
  stroke-width: 1.8;
  fill: none;
}

.header-icon-btn[aria-label="最新消息"] svg {
  transform: translateY(-2px);
}

.pill {
  border: 1px solid var(--stroke);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.cta {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 400;
  font-size: 1rem;
  height: 48px;
  cursor: pointer;
  box-shadow: none;
}

.cta:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-ink);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: #496F4B;
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: auto;
}

.btn:not(:disabled):hover {
  filter: brightness(0.96);
}

.btn.secondary {
  background: transparent;
  color: var(--btn-ghost-ink);
  border: 1px solid var(--cta-border-color);
}

.btn.secondary:hover {
  background: var(--hover-bg);
}

.inventory-btn:not(.primary):not(:disabled):hover,
.logout-btn:hover:not(:disabled),
.attendance-action-trigger:hover:not(:disabled),
.inventory-action-trigger:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: rgba(42, 34, 28, 0.32);
}

.btn:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-ink);
  border-color: var(--btn-disabled-border);
  cursor: not-allowed;
  opacity: 0.8;
  pointer-events: none;
}

.font-links .btn {
  justify-self: start;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.shell.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.shell.menu-open .menu-toggle span {
  width: 20px;
}

.shell.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.shell.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.layout {
  position: relative;
  padding-top: var(--header-height, 120px);
}

.side-menu {
  background: var(--panel-bg);
  border: none;
  border-right: 1px solid var(--stroke);
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 520px;
  height: calc(100dvh - var(--header-height, 120px) - 20px);
  margin-top: 0;
  font-family: "Noto Sans TC", "Metropolis", sans-serif;
  z-index: 30;
}

.side-menu-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--panel-bg);
}

.side-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--field-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.side-menu-avatar svg {
  width: 20px;
  height: 20px;
  stroke: #6b7280;
  stroke-width: 1.8;
  fill: none;
}

.side-menu-profile-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.side-menu-footer {
  display: block;
  padding: 16px;
  height: auto;
}

.menu-meta-info {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.theme-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.theme-mode-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.theme-mode-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

.theme-mode-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(192, 122, 42, 0.12);
}

.logout-btn {
  border: 1px solid var(--btn-ghost-ink);
  background: transparent;
  color: var(--btn-ghost-ink);
  padding: 0.3rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  width: 100%;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.language-switcher {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.6rem;
}

.language-switcher-options {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.language-switcher-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.language-switcher-btn.is-active {
  color: var(--accent);
  font-weight: 700;
}

.language-switcher-divider {
  color: var(--border-strong);
  font-size: 0.8rem;
  line-height: 1;
}

.menu-group {
  display: block;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.menu-details {
  display: grid;
  gap: 0;
  height: auto;
}

.menu-details summary {
  list-style: none;
  position: relative;
  padding-right: 36px;
}

.menu-details summary::-webkit-details-marker {
  display: none;
}

.menu-details summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 2px;
  background: var(--muted);
  transition: none;
}

.menu-details summary::before {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 14px;
  background: var(--muted);
  transition: none;
}

.menu-details[open] summary::before {
  opacity: 0;
}

.menu-sub {
  display: grid;
  gap: 0;
  padding-left: 0;
  height: auto;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-16px);
  background: var(--menu-sub-bg);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(42, 34, 28, 0.03);
}

.menu-sub {
  transition: max-height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.45s ease,
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-details[open] .menu-sub {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
}

@supports (-webkit-touch-callout: none) {
  header,
  .ai-tabs,
  .attendance-tabs,
  .canvas-loading {
    backdrop-filter: none !important;
  }

  .hero-visual::before,
  .hero-visual::after {
    filter: none;
  }
}

.menu-sub-item {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
  display: block;
}

.menu-sub-item a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  font-weight: 400;
  height: 48px;
}

.menu-sub-item a:hover {
  color: var(--text-primary);
}

.menu-status {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.menu-sub-item.active,
.menu-sub-item.active a {
  color: var(--accent);
}

.menu-sub-item.active a {
  background: var(--hover-bg);
}

.menu-item {
  padding: 0 16px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 400;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  height: 48px;
}

.menu-item:visited {
  color: var(--ink);
}

.menu-item:hover {
  background: var(--hover-bg);
}

.menu-item span {
  color: var(--text-secondary);
  font-size: 12px;
}

.menu-item.active {
  background: transparent;
  padding-left: 16px;
  padding-right: 16px;
  height: 48px;
}

.menu-item.active:not(summary) {
  background: var(--hover-bg);
  color: var(--accent);
}

.menu-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed rgba(42, 34, 28, 0.2);
  font-size: 12px;
  color: var(--muted);
}

.menu-user-info {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.9rem;
}

.menu-user-info p {
  margin: 0;
}

.menu-user-name {
  font-size: 1rem;
  font-weight: 500;
}

.menu-user-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.menu-user-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.menu-version {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.dashboard {
  display: block;
  margin-top: 0;
  padding: 0 2rem 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  position: relative;
}

.pull-refresh-indicator {
  position: absolute;
  top: 0.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 180;
  pointer-events: none;
  opacity: 0;
  transform: translateY(calc(-100% + var(--pull-refresh-distance, 0px)));
  transition: opacity 160ms ease, transform 160ms ease;
}

.pull-refresh-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.94);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(42, 34, 28, 0.12);
  backdrop-filter: blur(10px);
}

.pull-refresh-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid rgba(42, 34, 28, 0.18);
  border-top-color: var(--accent);
}

.pull-refresh-label {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body.pull-refresh-active .pull-refresh-indicator {
  opacity: 1;
}

body.pull-refresh-loading .pull-refresh-indicator {
  opacity: 1;
  transform: translateY(0);
}

body.pull-refresh-loading .pull-refresh-spinner {
  animation: pull-refresh-spin 0.75s linear infinite;
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.pos-page .dashboard {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

.dashboard-home {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(100dvh - var(--header-height, 68px));
  width: 100%;
  padding-top: 0;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  padding-left: 2rem;
  padding-right: 2rem;
  margin-left: auto;
  margin-right: 0;
}

.dashboard-home > * {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.dashboard > * {
  margin-bottom: 64px;
}

.dashboard > *:last-child {
  margin-bottom: 0;
}

.ci-dashboard {
  display: block;
  margin-top: 0;
  padding: 0 2rem 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
}

.ci-dashboard > * {
  margin-bottom: 1rem;
}

.ci-dashboard > *:last-child {
  margin-bottom: 0;
}

.ci-dashboard .hero-plain {
  margin-bottom: 1rem;
}

.ci-dashboard .tabs {
  margin-bottom: 1rem;
}

.ci-dashboard .tab-panels {
  margin-bottom: 1rem;
}

.ci-content {
  display: block;
  max-width: 900px;
  width: 100%;
}

.account-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 0;
  width: auto;
  overflow: hidden;
}

.accounts-page .account-card {
  border-radius: 16px;
}

.profile-page .account-card {
  padding: 18px;
}

.profile-page .account-panel {
  padding: 0;
}

.account-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.account-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.25rem 0;
  font-family: "Metropolis", "Noto Sans TC", sans-serif !important;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.account-tab.is-active {
  color: var(--ink);
}

.account-tab + .account-tab {
  border-left: 1px solid rgba(42, 34, 28, 0.15);
  padding-left: 1rem;
  margin-left: 1rem;
}

.account-panels {
  display: grid;
}

.account-panel {
  display: none;
  gap: 1.5rem;
}

.account-panel.is-active {
  display: grid;
}

.account-form {
  display: grid;
  gap: 1rem;
}

.account-form label {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.account-form input,
.account-form select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.account-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.account-table-header {
  display: none;
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.account-table-header.is-active {
  display: flex;
}

.account-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #fff;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  border: none;
}

.account-table th,
.account-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(42, 34, 28, 0.12);
  white-space: nowrap;
}

.account-table tr:last-child td {
  border-bottom: none;
}

.account-table th {
  background: #faf7f2;
  color: var(--muted);
  font-weight: 600;
}

.account-table th + th {
  box-shadow: inset 1px 0 0 rgba(42, 34, 28, 0.08);
}

.account-row-skeleton td {
  white-space: normal;
}

.account-skeleton-line {
  display: block;
  width: 100%;
  height: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1ece2 0%, #e8dfd2 50%, #f1ece2 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.account-skeleton-line.title {
  width: 70%;
}

.account-mobile-list,
.promotion-mobile-list {
  display: none;
}

.account-mobile-card-skeleton {
  display: grid;
  gap: 0.75rem;
}

.employee-accounts-page .account-card {
  background: #fff;
}

.schedule-dashboard {
  display: grid;
  gap: 1rem;
}

body.schedule-page .schedule-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 2rem calc(6rem + env(safe-area-inset-bottom, 0px));
}

body.schedule-page .schedule-dashboard > * {
  margin-bottom: 0;
}

body.schedule-page .schedule-dashboard > *:last-child {
  margin-bottom: 0;
}

.schedule-hero-card,
.schedule-calendar-card,
.schedule-day-card,
.schedule-fixed-card,
.schedule-form-card {
  background: #fff;
  padding: 1rem;
}

.schedule-hero-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.schedule-hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: min(100%, 360px);
}

.schedule-hero-stat {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(42, 34, 28, 0.08);
}

.schedule-hero-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.schedule-hero-stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
}

.schedule-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.schedule-day-card .schedule-eyebrow,
.schedule-fixed-card .schedule-eyebrow {
  letter-spacing: normal;
}

.schedule-title {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
}

.schedule-subtitle,
.schedule-panel-head p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.schedule-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 1rem;
}

body.schedule-page .schedule-tabs-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  height: auto;
  margin-bottom: 0;
  min-height: 0;
  overflow: visible;
}

.schedule-tab {
  border: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

body.schedule-page .schedule-panel {
  display: none;
  min-width: 0;
}

body.schedule-page .schedule-panel.is-active {
  display: grid;
  gap: 1rem;
  align-content: start;
  align-items: start;
}

body.schedule-page .schedule-page-tabs {
  display: flex;
  align-items: center;
  width: auto;
  margin-bottom: 0;
  overflow: visible;
}

@media (min-width: 1281px) {
  body.schedule-page .schedule-page-tabs .schedule-tab {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.schedule-add-open-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  column-gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background: #fff;
  border-top: 1px solid var(--stroke);
  box-shadow: none;
  z-index: 1400;
}

.schedule-add-open {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 1.2rem;
}

.schedule-add-open-wrap > .schedule-add-open + .schedule-add-open {
  margin-left: 0.5rem;
}

.btn.schedule-add-event-btn {
  background: #c07a2a !important;
  color: #fff !important;
  border: none !important;
}

html[data-theme="dark"] .btn.schedule-add-event-btn {
  background: #c0742a !important;
  color: #fff !important;
  border: none !important;
}

body.dialog-open .schedule-add-open-wrap {
  display: none;
}

.schedule-create-dialog {
  position: fixed;
  inset: 0;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.schedule-create-dialog[open] {
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 2200;
  opacity: 1;
}

.schedule-create-dialog::backdrop {
  background: rgba(42, 34, 28, 0.45);
}

.schedule-create-inner {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  min-height: 320px;
  height: auto;
  max-height: min(80vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.schedule-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0.75rem 1rem 0.5rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.schedule-create-header .dialog-close {
  align-self: start;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.schedule-create-tabs {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border-bottom: 1px solid rgba(42, 34, 28, 0.12);
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.schedule-create-tab {
  flex: 1;
  text-align: center;
  margin: 0;
  padding: 1rem 0;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  font-weight: 900;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  position: relative;
}

.schedule-create-tab.is-active {
  color: #7a4a1e;
}

.schedule-create-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #7a4a1e;
  border-radius: 2px;
}

.schedule-create-tabs .inventory-move-tab-divider {
  display: none;
}

.schedule-create-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0.75rem 1rem 1rem;
  overflow: visible;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
  box-sizing: border-box;
}

.schedule-create-panel {
  display: none;
  position: relative;
  z-index: 1;
}

.schedule-create-panel.is-active {
  display: block;
}

.schedule-create-inner > .account-dialog-actions,
#schedule-event-dialog .account-dialog-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(42, 34, 28, 0.08);
}

.schedule-dialog-dropdown {
  width: 100%;
  display: flex;
}

.schedule-dialog-dropdown .dropdown-trigger {
  min-width: 100%;
  width: 100%;
}

.schedule-dialog-dropdown .dropdown-menu {
  left: 0;
  right: auto;
  min-width: 100%;
  width: 100%;
  z-index: 2400;
}

.schedule-weekday-field {
  display: grid;
  gap: 0.65rem;
}

.schedule-weekday-label {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.schedule-weekday-chips {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.schedule-weekday-chip {
  position: relative;
  display: block;
  cursor: pointer;
}

.schedule-weekday-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.schedule-weekday-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(42, 34, 28, 0.14);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.schedule-weekday-chip input:checked + span {
  border-color: rgba(145, 84, 17, 0.46);
  background: rgba(239, 196, 132, 0.18);
  color: #7a4a1e;
  box-shadow: 0 0 0 3px rgba(239, 196, 132, 0.16);
}

html[data-ui-language="en"] .schedule-weekday-label {
  display: none;
}

.schedule-side-column,
.schedule-admin-grid,
.schedule-calendar-card,
.schedule-form,
.schedule-fixed-list,
.schedule-day-list,
.schedule-manage-day-list {
  display: grid;
  gap: 1rem;
}

.schedule-side-column {
  align-content: start;
}

.schedule-fixed-list,
.schedule-day-list,
.schedule-manage-day-list {
  margin-top: 1rem;
}

.schedule-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.schedule-panel-head h2,
.schedule-calendar-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink);
}

.schedule-day-card .schedule-panel-head {
  align-items: center;
}

.schedule-day-card .schedule-eyebrow {
  margin: 0;
}

.schedule-day-headline {
  margin: 0 0 0 auto;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

.schedule-day-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(239, 196, 132, 0.16);
  color: #915411;
  font-size: 0.84rem;
  font-weight: 700;
}

.schedule-calendar-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.schedule-calendar-heading {
  text-align: center;
}

.schedule-month-nav {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.schedule-calendar-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.schedule-calendar-weekdays,
.schedule-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.65rem;
}

.schedule-calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.schedule-calendar-weekdays span:first-child,
.schedule-calendar-weekdays span:last-child {
  color: #c83b3b;
}

.schedule-calendar-day {
  min-height: 118px;
  border: 1px solid rgba(42, 34, 28, 0.1);
  border-radius: 18px;
  padding: 0.8rem;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  -webkit-text-fill-color: currentColor;
}

.schedule-calendar-day:hover {
  border-color: rgba(145, 84, 17, 0.22);
  box-shadow: 0 12px 24px rgba(42, 34, 28, 0.08);
  transform: translateY(-1px);
}

.schedule-calendar-day.is-outside {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}

.schedule-calendar-day.is-today {
  border-color: rgba(145, 84, 17, 0.28);
}

.schedule-calendar-day.is-selected {
  border-color: rgba(145, 84, 17, 0.72);
  background: rgba(239, 196, 132, 0.22);
  box-shadow: 0 0 0 3px rgba(239, 196, 132, 0.28);
}

.schedule-calendar-day.is-selected .schedule-calendar-day-number {
  color: #7a4a1e;
  -webkit-text-fill-color: #7a4a1e;
}

.schedule-calendar-day-number {
  font-weight: 700;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

.schedule-calendar-day.has-event .schedule-calendar-day-number {
  color: #b42318;
  -webkit-text-fill-color: #b42318;
}

.schedule-calendar-day-body {
  display: grid;
  gap: 0.38rem;
}

.schedule-calendar-day-skeleton,
.schedule-item-card-skeleton,
.schedule-skeleton-line,
.schedule-skeleton-pill,
.schedule-skeleton-tag,
.schedule-skeleton-btn,
.schedule-skeleton-dot {
  background: linear-gradient(
    100deg,
    rgba(229, 221, 209, 0.72) 20%,
    rgba(245, 239, 230, 0.96) 45%,
    rgba(229, 221, 209, 0.72) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.schedule-calendar-day-skeleton {
  pointer-events: none;
  border-color: rgba(42, 34, 28, 0.08);
  box-shadow: none;
}

.schedule-skeleton-line,
.schedule-skeleton-pill,
.schedule-skeleton-tag,
.schedule-skeleton-btn {
  display: block;
  border-radius: 999px;
}

.schedule-skeleton-title-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.schedule-skeleton-line-title {
  width: 140px;
  height: 1.5rem;
}

.schedule-skeleton-line-date {
  width: 180px;
  height: 1.1rem;
  margin-left: auto;
}

.schedule-item-card-skeleton {
  min-height: 124px;
}

.schedule-item-card-skeleton.has-actions {
  min-height: 152px;
}

.schedule-skeleton-line-day-number {
  width: 22px;
  height: 16px;
  border-radius: 8px;
}

.schedule-skeleton-stack {
  display: grid;
  gap: 0.55rem;
}

.schedule-skeleton-pill {
  width: 84px;
  height: 34px;
}

.schedule-skeleton-line-meta {
  width: 150px;
  height: 16px;
}

.schedule-skeleton-line-note {
  width: 70%;
  height: 16px;
}

.schedule-skeleton-tag {
  width: 88px;
  height: 34px;
}

.schedule-skeleton-btn {
  width: 82px;
  height: 40px;
}

.schedule-skeleton-dot {
  display: inline-flex;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.schedule-calendar-chip,
.schedule-member-badge,
.schedule-mode-tag,
.schedule-source-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-calendar-chip-fixed,
.schedule-source-tag-fixed {
  background: #fff1dc;
  color: #9a5b00;
}

.schedule-calendar-chip-flexible,
.schedule-source-tag-manual {
  background: #e7f7ec;
  color: #1d6b3d;
}

.schedule-source-tag-leave {
  background: #ffe7ea;
  color: #b42318;
}

.schedule-calendar-chip-event,
.schedule-source-tag-event {
  background: #ffe7ea;
  color: #b42318;
}

.schedule-mode-tag-leave-type {
  background: #fff0f2;
  color: #9f1239;
}

.schedule-status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-status-tag-submitted {
  background: #edf2f7;
  color: #364152;
}

.schedule-status-tag-approved {
  background: #e7f7ec;
  color: #1d6b3d;
}

.schedule-status-tag-rejected,
.schedule-status-tag-cancelled {
  background: #ffe7ea;
  color: #b42318;
}

.schedule-mode-tag-fixed {
  background: #edf2f7;
  color: #364152;
}

.schedule-mode-tag-flexible {
  background: #f5f0ff;
  color: #6240a3;
}

.schedule-member-badge {
  border: 1px solid transparent;
}

.schedule-member-badge-1 {
  background: #e8f2ff;
  border-color: #bfd8ff;
  color: #0b3b7a;
}

.schedule-member-badge-2 {
  background: #e9f8ee;
  border-color: #bfe7ca;
  color: #165c36;
}

.schedule-member-badge-3 {
  background: #fff3e6;
  border-color: #f2cfab;
  color: #8a4b00;
}

.schedule-member-badge-4 {
  background: #f8eeff;
  border-color: #dcc1f6;
  color: #6b2e8a;
}

.schedule-member-badge-5 {
  background: #fdecef;
  border-color: #f3bec8;
  color: #8a2235;
}

.schedule-member-badge-6 {
  background: #eaf7f7;
  border-color: #bae3e3;
  color: #0f5c61;
}

.schedule-member-badge-7 {
  background: #fff7d9;
  border-color: #f2de8a;
  color: #7a5a00;
}

.schedule-member-badge-8 {
  background: #eef1f5;
  border-color: #cfd6dd;
  color: #374151;
}

.schedule-calendar-more {
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-item-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(42, 34, 28, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.schedule-item-card-leave {
  background: rgba(255, 247, 248, 0.92);
  border-color: rgba(180, 35, 24, 0.18);
}

.schedule-item-card-has-leave {
  border-color: rgba(180, 35, 24, 0.2);
}

.schedule-item-card-rule {
  background: rgba(255, 250, 243, 0.92);
}

.schedule-item-card-event {
  background: rgba(255, 247, 248, 0.92);
  border-color: rgba(180, 35, 24, 0.18);
}

.schedule-item-card-event:hover {
  border-color: rgba(180, 35, 24, 0.28);
}

.schedule-item-card:hover {
  border-color: rgba(145, 84, 17, 0.22);
  box-shadow: 0 12px 24px rgba(42, 34, 28, 0.08);
  transform: translateY(-1px);
}

.schedule-item-card-leave:hover,
.schedule-item-card-has-leave:hover {
  border-color: rgba(180, 35, 24, 0.28);
}

.schedule-item-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.schedule-item-main > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.schedule-item-name,
.schedule-item-meta,
.schedule-item-note {
  margin: 0;
}

.schedule-item-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.schedule-item-name .schedule-member-badge {
  font-size: 0.92rem;
}

.schedule-item-meta,
.schedule-item-note {
  color: var(--muted);
}

.schedule-item-leave-note {
  color: #b42318;
  font-weight: 600;
}

.schedule-item-callout {
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
}

.schedule-item-callout-leave {
  background: rgba(255, 231, 234, 0.72);
  border: 1px solid rgba(180, 35, 24, 0.14);
}

.schedule-item-callout-range {
  background: rgba(255, 241, 220, 0.58);
  border: 1px solid rgba(154, 91, 0, 0.12);
}

.schedule-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.schedule-tag-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.schedule-item-actions .schedule-delete-btn {
  background: transparent !important;
  border: 1px solid rgba(220, 38, 38, 0.45) !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

.schedule-item-actions .schedule-delete-btn:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

.schedule-detail-body {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.25rem 1.25rem;
  box-sizing: border-box;
}

.schedule-detail-form {
  display: grid;
  gap: 0.9rem;
  padding: 0;
}

.schedule-detail-form label {
  display: grid;
  gap: 0.4rem;
}

.schedule-detail-form textarea,
.schedule-detail-form input,
.schedule-detail-form select {
  width: 100%;
}

#schedule-detail-dialog .account-dialog-inner {
  position: relative;
}

#schedule-detail-dialog .account-dialog-title {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 1rem 1.25rem 0;
  background: inherit;
}

#schedule-detail-dialog .schedule-detail-edit,
#schedule-detail-dialog .schedule-detail-close {
  position: absolute;
  top: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

#schedule-detail-dialog .schedule-detail-close {
  right: 12px;
}

#schedule-detail-dialog .schedule-detail-edit {
  right: 52px;
}

#schedule-detail-dialog .schedule-detail-edit svg,
#schedule-detail-dialog .schedule-detail-close svg {
  width: 22px;
  height: 22px;
}

#schedule-detail-dialog .schedule-detail-edit svg path,
#schedule-detail-dialog .schedule-detail-close svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#schedule-detail-dialog .schedule-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
}

#schedule-detail-dialog .schedule-detail-delete {
  margin-right: auto;
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #dc2626;
}

#schedule-detail-dialog .schedule-detail-delete:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
  color: #dc2626;
}

#schedule-detail-dialog .schedule-detail-delete svg {
  width: 16px;
  height: 16px;
}

#schedule-detail-dialog .schedule-detail-delete svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#schedule-detail-dialog .account-form.schedule-detail-form {
  padding: 0;
}

.schedule-detail-row {
  display: grid;
  gap: 0.2rem;
}

.schedule-detail-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.schedule-detail-value {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.schedule-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.schedule-time-grid.is-hidden {
  display: none;
}

.schedule-member-alert {
  border: 1px solid rgba(145, 84, 17, 0.18);
  background: #fff6ea;
  color: #915411;
  padding: 0.85rem 1rem;
  border-radius: 14px;
}

.account-actions-cell {
  vertical-align: middle;
  text-align: right;
}

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.account-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.account-toolbar-filters {
  min-width: 0;
}

.account-action-menu {
  position: relative;
  display: inline-flex;
}

.account-action-trigger {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(42, 34, 28, 0.16);
  background: #fff;
  color: rgba(42, 34, 28, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.account-action-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.account-action-trigger:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: rgba(42, 34, 28, 0.32);
}

.account-action-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 168px;
  padding: 0.35rem;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(42, 34, 28, 0.16);
  display: grid;
  gap: 0.2rem;
  z-index: 40;
}

.account-action-dropdown-menu[hidden] {
  display: none !important;
}

.account-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(42, 34, 28, 0.82);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.account-menu-item:hover:not(:disabled) {
  background: rgba(42, 34, 28, 0.08);
}

.account-menu-item.danger {
  color: #dc2626;
}

.account-action-dropdown-menu .account-delete,
.account-action-dropdown-menu .account-toggle.danger,
.account-table .account-action-dropdown-menu .account-delete {
  background: transparent !important;
  border: none !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

.account-menu-item.danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.08);
}

.account-search,
.account-sort {
  font-size: 16px;
  font-family: inherit;
  background: transparent;
}

.account-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
  background: transparent;
  position: relative;
  min-width: 220px;
  height: 40px;
}

.account-search-icon {
  width: 18px;
  height: 18px;
  stroke: rgba(42, 34, 28, 0.7);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-search {
  border: none;
  padding: 0.45rem 0.2rem;
  width: 100%;
}

.account-search:focus,
.account-sort:focus {
  outline: none;
}

.account-search::selection {
  background: rgba(239, 196, 132, 0.35);
}

.account-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
  background: #fff;
  position: relative;
  height: 40px;
}

.account-sort-wrap::after {
  content: none;
}

.account-sort-wrap:focus-within {
  border-color: rgba(42, 34, 28, 0.45);
  box-shadow: 0 0 0 3px rgba(239, 196, 132, 0.25);
}

.account-search-wrap:focus-within {
  border-color: rgba(42, 34, 28, 0.45);
  box-shadow: 0 0 0 3px rgba(239, 196, 132, 0.25);
}

.account-sort-icon {
  width: 18px;
  height: 18px;
  stroke: rgba(42, 34, 28, 0.75);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-sort {
  border: none;
  background: transparent;
  padding: 0.45rem 0.2rem;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.account-sort option {
  background: #fff;
  color: var(--ink);
}

.account-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(42, 34, 28, 0.18);
  background: #fff6ea;
  color: #6b4b28;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

#account-alert-text {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .account-alert {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

.account-alert.is-error {
  border-color: rgba(185, 28, 28, 0.4);
  background: #fff1f2;
  color: #991b1b;
}

.account-actions-locked {
  color: var(--muted);
  font-size: 0.85rem;
}

.account-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
}

.account-table tr.is-disabled {
  color: #a39a8c;
  background: rgba(42, 34, 28, 0.04);
}

.account-table tr.is-disabled td {
  color: inherit;
}

.btn.danger {
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #dc2626;
}

.btn.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.account-dialog {
  border: none;
  background: transparent;
  padding: 0;
}

.account-dialog::backdrop {
  background: rgba(42, 34, 28, 0.45);
  animation: dialog-backdrop 0.2s ease;
}

.account-dialog-inner {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 0;
  max-width: 520px;
  width: min(90vw, 520px);
  max-height: calc(100dvh - 2rem);
  margin: 0;
  position: relative;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-dialog[open] {
  display: grid;
  place-items: center;
}

.account-dialog[open] .account-dialog-inner {
  animation: dialog-pop 0.22s ease;
}

.account-dialog.is-closing .account-dialog-inner {
  animation: dialog-pop-out 0.18s ease forwards;
}

@keyframes dialog-pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dialog-pop-out {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.96);
    opacity: 0;
  }
}

@keyframes dialog-backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.account-dialog-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink);
  padding: 0.75rem 1rem 0.5rem;
  font-weight: 700;
}

.account-dialog-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  background: inherit;
}

.account-dialog-body {
  font-size: 1rem;
  background: inherit;
}

.account-dialog-header {
  background: inherit;
}

.account-dialog-inner .account-form {
  padding: 0 1rem 1rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#account-dialog .account-form,
#account-edit-dialog .account-form {
  flex: 1 1 auto;
}

#account-dialog .account-dialog-actions-fixed,
#account-edit-dialog .account-dialog-actions-fixed {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid rgba(42, 34, 28, 0.08);
  background: inherit;
  flex: 0 0 auto;
}

#home-tools-dialog .account-form,
#home-quick-links-dialog .account-form {
  padding-bottom: 1rem;
}

#home-tools-dialog .account-dialog-actions,
#home-quick-links-dialog .account-dialog-actions {
  position: static;
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid rgba(42, 34, 28, 0.08);
  background: inherit;
}

@media (max-width: 640px) {
  #account-dialog .account-form,
  #account-edit-dialog .account-form {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  #account-dialog .account-dialog-actions-fixed,
  #account-edit-dialog .account-dialog-actions-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }

  #home-tools-dialog .account-form,
  #home-quick-links-dialog .account-form {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  #home-tools-dialog .account-dialog-actions,
  #home-quick-links-dialog .account-dialog-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }
}

#logout-confirm-dialog .account-dialog-inner {
  padding: 1rem;
}

#logout-confirm-dialog h3 {
  margin: 0 0 0.5rem;
  padding-right: 2rem;
  font-size: 1.1rem;
}

#logout-confirm-dialog p {
  margin: 0 0 1rem;
  color: var(--ink-subtle);
}

#profile-edit-dialog.is-password #profile-edit-current-row,
#profile-edit-dialog.is-password #profile-edit-new-row {
  display: none;
}

#profile-edit-dialog.is-password .account-form {
  gap: 1rem;
}

#profile-edit-password-fields {
  gap: 1rem;
}

#profile-edit-password-fields:not([hidden]) {
  display: grid;
}

.account-dialog-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-static {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-value {
  font-size: 0.95rem;
  color: var(--ink);
}

.profile-lock {
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-edit {
  padding: 0.2rem 0.4rem;
  min-width: auto;
  border: none;
  background: transparent;
}

.profile-edit .icon-edit {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  height: 40px;
  padding-right: 44px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.custom-date-picker-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  z-index: 2398;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.custom-date-picker {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, calc(100vw - 24px));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  z-index: 2399;
  opacity: 1;
}

.custom-date-picker.is-modal {
  width: min(360px, calc(100vw - 24px));
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.custom-date-picker-backdrop.is-modal {
  background: rgba(42, 34, 28, 0.32);
  display: block;
}

.custom-date-picker.is-modal.is-open {
  animation: dialog-pop 0.22s ease;
  opacity: 1;
}

.custom-date-picker.is-modal.is-closing {
  animation: dialog-pop-out 0.18s ease forwards;
}

.custom-date-picker-backdrop.is-modal.is-open {
  opacity: 1;
}

.custom-date-picker-backdrop.is-modal.is-closing {
  opacity: 0;
}

.custom-date-picker-header,
.custom-date-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.custom-date-picker-header {
  margin-bottom: 0.75rem;
}

.custom-date-picker-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.custom-date-picker-nav,
.custom-date-picker-action {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 0 0.75rem;
  cursor: pointer;
  font: inherit;
}

.custom-date-picker-nav {
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.custom-date-picker-weekdays,
.custom-date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.custom-date-picker-weekdays {
  margin-bottom: 0.4rem;
}

.custom-date-picker-weekdays span {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.custom-date-picker-weekdays span:first-child,
.custom-date-picker-weekdays span:last-child {
  color: #c83b3b;
}

.custom-date-picker-day {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  min-height: 38px;
  cursor: pointer;
  font: inherit;
}

.custom-date-picker-day.is-outside {
  color: rgba(42, 34, 28, 0.38);
}

.custom-date-picker-day.is-today {
  border-color: rgba(192, 116, 42, 0.35);
}

.custom-date-picker-day.is-selected {
  background: #c0742a;
  color: #fff;
}

.custom-date-picker-day:hover,
.custom-date-picker-nav:hover,
.custom-date-picker-action:hover {
  background: rgba(42, 34, 28, 0.06);
}

.custom-date-picker-day.is-selected:hover {
  background: #c0742a;
}

.custom-date-picker-footer {
  margin-top: 0.75rem;
}

.custom-date-picker-footer .custom-date-picker-action {
  flex: 1 1 0;
}


.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 34, 28, 0.25);
  border: none;
  z-index: 20;
}

.hero {
  background: var(--card);
  border-radius: 28px;
  border: 1px solid var(--stroke);
  padding: 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.hero.hero-assistant {
  grid-template-columns: 1fr;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2.5rem 0 0;
}

.hero-assistant-inner {
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin-left: auto;
  margin-right: auto;
}

.typing-text {
  font-weight: 500;
}

.assistant-orb {
  width: 64px;
  height: 64px;
  position: relative;
  border-radius: 999px;
  overflow: visible;
  opacity: 0;
  animation: assistant-firefly-float 3.4s ease-in-out infinite, assistant-orb-fade-in 0.5s ease forwards;
  isolation: isolate;
}

.assistant-firefly-core {
  position: absolute;
  inset: 0;
  display: none;
}

.assistant-firefly-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff7c2 0%, #f0d68a 45%, rgba(240, 214, 138, 0) 70%);
  box-shadow: 0 0 12px rgba(237, 188, 96, 0.7);
  opacity: 0.95;
  --count: 100;
  --angle: calc(var(--i, 0) * (360deg / var(--count)));
  --start-r: 56px;
  --start-y: 0px;
  animation: assistant-firefly-dot 1s cubic-bezier(0.2, 0.9, 0.25, 1) 1 forwards;
}

.assistant-firefly-dot:nth-child(6n + 1) { --start-r: 96px; --start-y: -22px; }
.assistant-firefly-dot:nth-child(6n + 2) { --start-r: 86px; --start-y: 18px; }
.assistant-firefly-dot:nth-child(6n + 3) { --start-r: 92px; --start-y: -26px; }
.assistant-firefly-dot:nth-child(6n + 4) { --start-r: 80px; --start-y: 22px; }
.assistant-firefly-dot:nth-child(6n + 5) { --start-r: 94px; --start-y: 14px; }
.assistant-firefly-dot:nth-child(6n) { --start-r: 84px; --start-y: -18px; }

@keyframes assistant-orb-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes assistant-firefly-float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-1.5px) rotate(90deg);
  }
  50% {
    transform: translateY(-3px) rotate(180deg);
  }
  75% {
    transform: translateY(-1.5px) rotate(270deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

@keyframes assistant-firefly-dot {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--start-r)) translateY(var(--start-y));
  }
  25% {
    opacity: 0.95;
  }
  100% {
    opacity: 1;
    transform: rotate(calc(var(--angle) + 72deg)) translateX(28px) translateY(0);
  }
}


.assistant-chat {
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 0.75rem;
  flex: 0 0 auto;
  height: auto;
  align-self: start;
}

.assistant-chat::before,
.assistant-chat::after {
  content: "";
  position: fixed;
  left: var(--assistant-chat-left, 50%);
  width: var(--assistant-chat-width, 720px);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.assistant-chat::before {
  top: var(--header-height, 68px);
  height: 2.5rem;
  background: #fff;
  left: 0;
  width: 100vw;
}

.assistant-chat::after {
  bottom: 0;
  height: 84px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 70%);
  left: 0;
  width: 100vw;
}

body.assistant-mode .assistant-chat::before,
body.assistant-mode .assistant-chat::after {
  opacity: 1;
}

.assistant-messages {
  display: grid;
  gap: 0.75rem;
  height: auto;
}

.assistant-message {
  display: inline-flex;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 100%;
  text-align: left;
  word-break: break-word;
  height: auto;
  align-self: start;
}

.assistant-message.user {
  justify-self: end;
  background: #4b6f4b;
  color: #fff;
  border-top-right-radius: 6px;
}

.assistant-message.bot {
  justify-self: start;
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  border-top-left-radius: 6px;
  padding: 0;
  text-align: left;
}

.assistant-input-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  --assistant-btn-inset-x: 1.25rem;
  --assistant-btn-inset-y: 1rem;
}

.assistant-input {
  width: 100%;
  font-size: 16px;
  line-height: 1.6;
  min-height: 128px;
  padding: 0.9rem 0.9rem 2.8rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: #fff;
  resize: none;
}

.assistant-input::placeholder {
  color: #aaa39b;
}

.assistant-attach {
  position: absolute;
  left: var(--assistant-btn-inset-x);
  bottom: var(--assistant-btn-inset-y);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.assistant-attach svg {
  width: 18px;
  height: 18px;
}

.assistant-send {
  position: absolute;
  right: var(--assistant-btn-inset-x);
  bottom: var(--assistant-btn-inset-y);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #e6e6e6;
  color: #9b9b9b;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
}

.assistant-send.is-ready,
.assistant-send.is-sending {
  background: #4b6f4b;
  color: #fff;
}

.assistant-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}

.assistant-send .icon-stop {
  display: none;
}

.assistant-send.is-sending {
  box-shadow: 0 10px 24px rgba(75, 111, 75, 0.25);
}

.assistant-send.is-sending .icon-send {
  display: none;
}

.assistant-send.is-sending .icon-stop {
  display: block;
}

.assistant-file-list {
  width: 100%;
  max-width: 720px;
  margin: 0.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.assistant-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #d9d4ca;
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  color: #3d3d3d;
}

.assistant-file-chip button {
  border: none;
  background: transparent;
  color: #8e8881;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.assistant-message.bot.is-loading {
  padding: 0.25rem 0;
}

.assistant-message.bot.is-loading .assistant-skeleton {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    100deg,
    rgba(166, 166, 166, 0.8) 20%,
    rgba(210, 210, 210, 1) 45%,
    rgba(166, 166, 166, 0.8) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

html[data-theme="dark"] .assistant-message.bot.is-loading .assistant-skeleton {
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.14) 20%,
    rgba(255, 255, 255, 0.5) 45%,
    rgba(255, 255, 255, 0.14) 70%
  );
}

.assistant-message.bot.is-loading .assistant-skeleton + .assistant-skeleton {
  margin-top: 0.5rem;
}

html[data-theme="dark"] .assistant-message.user,
html[data-theme="dark"] body.assistant-mode .assistant-message.user {
  background: var(--accent-2) !important;
  color: #f3fbf5 !important;
  border-color: var(--accent-2) !important;
  -webkit-text-fill-color: currentColor !important;
}

.assistant-end {
  align-self: flex-start;
  justify-self: start;
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--accent);
  -webkit-text-fill-color: currentColor;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  position: fixed;
  top: calc(var(--header-height, 68px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 2rem));
  justify-content: flex-start;
  z-index: 6;
}

.assistant-end svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}

.assistant-mode .assistant-end {
  display: inline-flex;
}

.assistant-mode .typing-text,
.assistant-mode .timeline,
.assistant-mode .assistant-orb {
  display: none;
}

.assistant-mode .hero-assistant-inner {
  gap: 1.25rem;
  min-height: 100%;
}

.assistant-mode .assistant-input-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  padding: 0;
  z-index: 20;
  width: 100%;
  max-width: 736px;
  margin: 0 auto;
}

.assistant-mode .assistant-chat {
  margin-bottom: 0;
  margin-top: 0;
  padding-bottom: 220px;
}

body.assistant-mode .dashboard-home {
  min-height: calc(100dvh - var(--header-height, 120px) - 12px);
  padding-top: 0;
  padding-bottom: 0;
  justify-content: flex-start;
}

body.assistant-mode .home-quick-links {
  display: none !important;
}

body.assistant-mode .home-tools {
  display: none;
}

.assistant-copy {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  width: auto;
}

.assistant-copy-row {
  display: block;
  margin-top: 1rem;
}

.assistant-image-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.assistant-generated-image {
  margin-top: 0.85rem;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #fff;
  padding: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.assistant-generated-image-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f2eb;
  border: 1px solid var(--stroke);
}

.assistant-generated-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.assistant-generated-image-meta {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.assistant-generated-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.assistant-generated-image-action {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.assistant-generated-image-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.assistant-generated-image-thumb {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #fff;
}

.assistant-generated-image-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.assistant-source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.assistant-source-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  padding: 0.15rem 0.6rem;
  line-height: 1;
  font-size: 0.8rem;
  vertical-align: top;
}

.assistant-source-pill p {
  margin: 0;
  display: block;
  font-size: inherit;
  line-height: 1;
  color: var(--ink);
}

.assistant-table-wrap {
  margin-top: 0.75rem;
}

.assistant-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.assistant-table th,
.assistant-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.assistant-table tbody tr:last-child td {
  border-bottom: none;
}

.assistant-image-thumb {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #fff;
}

.assistant-image-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.history-thumb.is-skeleton {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: linear-gradient(
    100deg,
    rgba(230, 226, 219, 0.7) 20%,
    rgba(255, 255, 255, 0.9) 45%,
    rgba(230, 226, 219, 0.7) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  background: rgba(33, 33, 33, 0.92);
  color: #fff;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  z-index: 100;
  opacity: 0;
  white-space: nowrap;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.assistant-copy:hover {
  text-decoration: underline;
}

.assistant-copy svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}


.hero.hero-plain {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  gap: 0;
  grid-template-columns: 1fr;
}

.hero.hero-plain {
  padding-bottom: 16px;
}

.hero.hero-plain h1,
.hero.hero-plain h3 {
  margin-bottom: 0;
}

.hero h1,
.hero h3 {
  margin: 0 0 12px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(63, 107, 86, 0.12);
  color: var(--accent-2);
  font-size: 12px;
}

.hero-visual {
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(192, 122, 42, 0.25), rgba(63, 107, 86, 0.2));
  position: relative;
  overflow: hidden;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  filter: blur(4px);
}

.hero-visual::before {
  width: 180px;
  height: 180px;
  background: #f5c27d;
  top: -40px;
  left: -30px;
}

.hero-visual::after {
  width: 220px;
  height: 220px;
  background: #4f7a61;
  bottom: -60px;
  right: -40px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}


.section-grid {
  display: block;
}

.section-grid > * {
  margin-bottom: 1rem;
}

.section-grid > *:last-child {
  margin-bottom: 0;
}

.section-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--stroke);
  display: grid;
  gap: 24px;
  min-height: 120px;
}

.section-title {
  display: grid;
  gap: 1rem;
}

.section-card h3 {
}

.section-card p {
  color: var(--muted);
  line-height: 1.5;
}

.mascot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.mascot-gallery img {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background: rgba(255, 255, 255, 0.6);
}

#section-character-spec {
  margin-top: 2rem;
  clear: both;
}

.brand-name {
  display: grid;
  gap: 1rem;
}

.mascot-spec {
  display: grid;
  gap: 12px;
  line-height: 1.6;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
}

.mascot-summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-direction: column;
}

.mascot-summary::-webkit-details-marker {
  display: none;
}

.mascot-summary::after {
  content: "▸";
  font-size: 0.9em;
  transition: transform 0.2s ease;
  position: absolute;
  right: 16px;
  top: 16px;
}

.mascot-spec[open] .mascot-summary::after {
  transform: rotate(90deg);
}

.mascot-summary h3 {
  margin: 0;
}

.mascot-summary p {
  margin: 0;
  color: var(--muted);
}

.mascot-spec {
  position: relative;
}

.mascot-body {
  display: grid;
  gap: 12px;
}

.mascot-spec hr {
  border: 0;
  border-top: 1px solid rgba(42, 34, 28, 0.15);
  margin: 4px 0;
}

.mascot-spec blockquote {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid rgba(42, 34, 28, 0.25);
  background: rgba(255, 255, 255, 0.6);
}

.mascot-spec ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.mascot-spec p {
  color: var(--muted);
}

.brand-name-row {
  display: grid;
  gap: 16px;
}

.font-links {
  display: grid;
  gap: 8px;
}

.font-links > div {
  display: grid;
  gap: 8px;
}

.font-links .latin-sample {
  font-family: "Metropolis", sans-serif;
}

@media (min-width: 1281px) {
  .brand-name-row {
    grid-template-columns: 1fr 1fr;
  }

  .brand-name-row .brand-name + .brand-name {
    padding-left: 16px;
    border-left: 1px solid rgba(42, 34, 28, 0.2);
  }
}

.logo-gallery {
  display: grid;
  gap: 0.75rem;
}

.logo-row {
  display: grid;
  gap: 0.75rem;
}

.logo-mark {
  max-height: 100px;
  width: auto;
  height: 100px;
  display: block;
}

.logo-text {
  max-height: 80px;
  width: auto;
  height: 80px;
  display: block;
}

.color-block {
  display: grid;
  gap: 8px;
}

.color-bar {
  display: flex;
  width: 100%;
  height: 100px;
}

.color-bar .swatch {
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0.75rem;
  color: #fff;
}

.color-bar .swatch:nth-child(1) {
  background: #496F4B;
}

.color-bar .swatch:nth-child(2) {
  flex: 1;
  background: #994F3C;
}

.color-bar .swatch:nth-child(3) {
  flex: 1;
  background: #EFC484;
  color: #3D3D3D;
}

.color-bar .swatch:nth-child(3) p {
  color: #3D3D3D;
}

.color-bar .swatch.light {
  color: #fff;
}

.color-bar.foundation .swatch:nth-child(1) {
  background: #3D3D3D;
}

.color-bar.foundation .swatch:nth-child(2) {
  background: #DED8C9;
  color: #3D3D3D;
}

.color-bar.foundation .swatch:nth-child(2) p {
  color: #3D3D3D;
}

.color-bar.foundation .swatch:nth-child(3) {
  background: #87644E;
}

.color-bar.foundation .swatch:nth-child(3),
.color-bar.foundation .swatch:nth-child(3) p {
  color: #fff;
}

.color-bar.foundation .swatch {
  color: #fff;
}

.color-bar .swatch p {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.color-bar .swatch.dark {
  color: #fff;
}

.usage-guidance {
  display: grid;
  gap: 8px;
}

@media (min-width: 1281px) {
  .side-menu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    height: 100dvh;
  }

  .dashboard {
    position: fixed;
    left: 260px;
    top: var(--header-height, 68px);
    bottom: 0;
    width: calc(100dvw - 260px);
    height: auto;
    overflow-y: auto;
  }

  .assistant-mode .assistant-input-wrap {
    left: 260px;
    right: 0;
  }

  .logo-row {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .logo-row img + img {
    padding-left: 16px;
    border-left: 1px solid rgba(42, 34, 28, 0.2);
  }

  .brand-name-row {
    grid-template-columns: 1fr 1fr;
  }
}

.anchor-nav {
  position: fixed;
  top: 120px;
  right: 16px;
  width: 120px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(42, 34, 28, 0.15);
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.anchor-nav a {
  color: var(--muted);
  text-decoration: none;
}

.anchor-nav a:hover {
  color: var(--ink);
}

.empty-panel {
  border: 1px dashed rgba(42, 34, 28, 0.2);
  padding: 18px;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--stroke);
  display: grid;
  gap: 8px;
  min-height: 120px;
}

.card h3 {
  margin: 0;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.canvas-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: start;
}

.ai-tabs {
  display: none;
  gap: 0.5rem;
}

.ai-tab {
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: 1rem 0;
  font-size: 0.9rem;
  cursor: pointer;
  flex: 1;
  text-align: center;
  position: relative;
}

.ai-tab.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-tab.is-active {
  color: #7a4a1e;
  font-weight: 600;
}

.ai-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #7a4a1e;
  border-radius: 2px;
}

.canvas-output {
  border: 1px solid var(--stroke);
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}



#canvas-output-slot {
  display: flex;
  min-height: 0;
}

#canvas-output-slot .canvas-output {
  width: 100%;
}

#canvas-host {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

#canvas-host.is-loading {
  min-height: 320px;
  background: linear-gradient(
    100deg,
    #e6e2db 20%,
    #ffffff 45%,
    #e6e2db 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

#canvas-host.is-loading canvas {
  opacity: 0;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: block;
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  transition: opacity 0.2s ease;
}

.canvas-empty-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(480px, 100%);
  transform: translate(-50%, -50%);
}

.canvas-empty h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--ink);
  height: auto;
}

.canvas-empty p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  height: auto;
}

body.has-output .canvas-empty,
#canvas-host.is-loading .canvas-empty {
  opacity: 0;
  pointer-events: none;
}

.canvas-status {
  position: absolute;
  inset: auto 16px 16px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-output canvas {
  width: auto;
  height: 100%;
  max-width: 100%;
  display: block;
  background: transparent;
}

#canvas-host canvas,
#dialog-canvas-host canvas {
  opacity: 0;
}

body.has-output #canvas-host canvas,
body.has-output #dialog-canvas-host canvas {
  opacity: 1;
}


.canvas-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  backdrop-filter: blur(2px);
}

.output-settings {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.output-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.output-option {
  border: 1px solid var(--stroke);
  background: transparent;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.75rem;
  height: 48px;
}

.output-option.active {
  border-color: rgba(192, 122, 42, 0.4);
  color: var(--accent);
}

.canvas-dialog {
  border: none;
  padding: 0;
  background: transparent;
  width: min(92vw, 740px);
  z-index: 2000;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.canvas-dialog::backdrop {
  background: rgba(20, 16, 12, 0.5);
}

.canvas-dialog-inner {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  max-height: 90vh;
  overflow: auto;
  margin-top: auto;
  width: 100%;
  position: relative;
}

.canvas-dialog[open] {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  border-radius: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: rgba(42, 34, 28, 0.7);
}

.output-actions {
  display: flex;
  justify-content: stretch;
}

.output-actions .btn {
  width: 100%;
  justify-content: center;
  height: 48px;
  font-size: 1rem;
  font-weight: 400;
}

.canvas-output-dialog .output-actions {
  justify-content: flex-end;
}

.canvas-output-dialog .output-actions .btn {
  width: auto;
  min-width: 120px;
}

.stop-button {
  display: none;
  background: #7a5c49;
}

.generate-actions {
  display: grid;
  gap: 0.75rem;
}

.view-output {
  display: none;
}

.output-actions .btn:disabled {
  cursor: not-allowed;
}

.canvas-input {
  display: grid;
  gap: 0.75rem;
}

.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  background: var(--panel-bg);
}

.ai-dashboard {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
}

.ai-dashboard .canvas-panel {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.ai-dashboard .canvas-output,
.ai-dashboard .canvas-input {
  height: 100%;
}

.output-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  gap: 0.75rem;
}

.output-tags {
  position: static !important;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.output-top.has-tags #canvas-host {
  margin-top: 0;
}

.output-tag {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(205, 182, 149, 0.25);
  border: 1px solid rgba(205, 182, 149, 0.65);
  font-size: 0.75rem;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.output-bottom {
  display: grid;
  gap: 0.75rem;
}

.audit-panel {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  gap: 0.5rem;
}

.audit-panel[hidden] {
  display: none !important;
}

.audit-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
}

.audit-header h4 {
  margin: 0;
}

.audit-status {
  font-size: 0.75rem;
  color: var(--muted);
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink);
  max-height: calc(1.5em * 4 + 0.4rem * 3);
  overflow-y: auto;
}

.audit-progress {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
  position: relative;
  padding-right: 1.2rem;
}

.audit-panel img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.audit-progress::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid rgba(42, 34, 28, 0.35);
  border-top-color: rgba(42, 34, 28, 0.7);
  animation: audit-spin 1s linear infinite;
}

@keyframes audit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.audit-item.pass {
  color: #2f5f33;
}

.audit-item.fail {
  color: #9b2c2c;
}

.audit-item.warn {
  color: #8a6d1d;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--cta-border-color);
  width: auto;
  white-space: nowrap;
}

.btn.ghost.profile-edit,
.btn.ghost.history-toggle {
  border: none;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--hover-bg);
}

.btn.ghost.history-toggle {
  background: #DED8C9;
}

input:hover:not(:disabled):not([readonly]),
select:hover:not(:disabled),
textarea:hover:not(:disabled):not([readonly]),
.dropdown-trigger:hover:not(:disabled),
.account-search:hover,
.account-sort:hover,
.assistant-input:hover,
.inventory-input-row input:hover,
.dropdown-search:hover {
  border-color: rgba(42, 34, 28, 0.32);
  background: rgba(255, 255, 255, 0.92);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  width: auto;
  white-space: nowrap;
}

.text-btn:hover {
  color: var(--ink);
  text-decoration: underline;
}

.history-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 2px;
  border-radius: 12px 0 0 12px;
  padding: 12px 10px;
  z-index: 4;
  background: #DED8C9;
  transition: transform 0.25s ease;
}

.history-toggle:not(.assistant-history-toggle):not(.rag-qa-toggle) {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

@media (min-width: 768px) {
  .history-toggle:not(.assistant-history-toggle):not(.rag-qa-toggle),
  .assistant-history-toggle {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    padding: 10px;
  }
}

.history-toggle.is-open:not(.assistant-history-toggle):not(.rag-qa-toggle) {
  transform: translateX(calc(-1 * min(320px, 92vw))) translateY(-50%);
}

.assistant-history-toggle {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  letter-spacing: normal;
  border-radius: 12px 0 0 12px;
  padding: 7px;
  width: auto;
  min-width: 36px;
  max-width: 36px;
  height: auto;
  min-height: 36px;
  max-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: #3D3D3D;
  border-color: #3D3D3D;
  color: #fff;
  z-index: 22;
  transition: transform 0.25s ease;
}

.assistant-history-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-toggle-icon {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.history-toggle .history-toggle-icon-close {
  display: none;
}

.history-toggle.is-open .history-toggle-icon-open {
  display: none;
}

.history-toggle.is-open .history-toggle-icon-close {
  display: block;
}

.assistant-history-toggle .assistant-history-icon-close {
  display: none;
}

.assistant-history-toggle.is-open .assistant-history-icon-open {
  display: none;
}

.assistant-history-toggle.is-open .assistant-history-icon-close {
  display: block;
}

.assistant-history-toggle.is-open {
  transform: translateX(calc(-1 * min(320px, 92vw))) translateY(-50%);
}

@media (min-width: 1921px) {
  .assistant-history-toggle.is-open {
    transform: translateX(-420px) translateY(-50%);
  }
}

.output-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 0.5rem;
  height: 100%;
  justify-items: stretch;
  justify-content: start;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.output-history-grid.is-empty {
  min-height: 100%;
  align-content: stretch;
}

.history-thumb {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  position: relative;
  width: 100%;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assistant-history-grid {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.assistant-history-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  display: grid;
  gap: 0.45rem;
  position: relative;
}

.assistant-history-question {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.assistant-history-answer {
  color: rgba(42, 34, 28, 0.75);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.assistant-history-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #4b5563;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.assistant-history-item:hover .assistant-history-remove,
.assistant-history-item:focus-within .assistant-history-remove {
  opacity: 1;
  pointer-events: auto;
}

.assistant-history-remove:hover {
  background: #dc2626;
  color: #fff;
}

.assistant-history-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(42, 34, 28, 0.6);
  font-size: 0.9rem;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-content: flex-start;
  gap: 1rem;
}

@media (min-width: 1281px) {
  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 420px));
    justify-content: start;
  }
}

@media (min-width: 1281px) and (max-width: 1920px) {
  .pos-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1280px) {
  .pos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 767px) {
  .pos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .pos-toolbar {
    display: block;
  }

  .pos-toolbar > * + * {
    margin-top: 1rem;
  }

  .pos-page .pos-toolbar .account-search-wrap {
    display: flex;
    width: 100%;
    min-width: 0;
  }

  .pos-toolbar-actions {
    width: 100%;
  }

  .pos-toolbar-actions .btn {
    flex: 1;
    width: 100%;
  }
}

.pos-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 420px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0.55rem 0.8rem;
  background: #fff;
}

.pos-search input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
  background: transparent;
  font-family: inherit;
}

.pos-search-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  color: rgba(42, 34, 28, 0.6);
}

.pos-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.pos-toolbar-actions .btn {
  height: 40px;
  padding: 0 1.1rem;
}

.pos-toolbar-actions .btn:not(.cta) {
  background: #c0742a;
  border-color: #c0742a;
  color: #fff;
}

.pos-edit-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-right: 0.35rem;
}

.pos-edit-icon-check {
  display: none;
}

body.pos-editing .pos-edit-icon-pencil {
  display: none;
}

body.pos-editing .pos-edit-icon-check {
  display: block;
}

.pill-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.pos-skeleton-pill {
  width: 92px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(
    100deg,
    rgba(166, 166, 166, 0.24) 20%,
    rgba(210, 210, 210, 0.4) 45%,
    rgba(166, 166, 166, 0.24) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  flex: 0 0 auto;
}

.pill-tab-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.pill-tab {
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pill-tab-shell.is-editable .pill-tab {
  padding-right: 2.2rem;
}

.pill-tab-edit {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  cursor: pointer;
}

.pill-tab-shell.is-editable:hover .pill-tab-edit,
.pill-tab-shell.is-editable .pill-tab-edit,
.pill-tab-shell.is-editable:focus-within .pill-tab-edit {
  opacity: 0.8;
  pointer-events: auto;
}

.pill-tab-edit:hover {
  opacity: 1;
}

.pill-tab-edit svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill-tab.pill-tab-add {
  border-style: dashed;
  border-color: rgba(42, 34, 28, 0.28);
  background: rgba(42, 34, 28, 0.02);
  color: rgba(42, 34, 28, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1;
  min-height: 36px;
  box-sizing: border-box;
  vertical-align: middle;
  text-align: center;
}

.pill-tab.pill-tab-add:hover {
  border-color: rgba(192, 116, 42, 0.42);
  color: #c0742a;
}

.pill-tab.pill-tab-add span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.pill-tab-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

#pos-category-dialog .account-dialog-actions {
  padding: 0;
}

#pos-category-dialog #pos-category-delete {
  margin-right: auto;
  background: transparent !important;
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
  border: 0 !important;
  padding: 0 !important;
  gap: 0.35rem;
  box-shadow: none !important;
}

#pos-category-dialog #pos-category-delete:hover {
  background: transparent !important;
}

#pos-category-dialog #pos-category-delete svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#pos-category-delete-dialog .account-dialog-actions {
  padding: 0;
}

.pill-tab.is-active {
  border-color: #c0742a;
  color: #c0742a;
}

.pos-category-dropdown {
  width: 100%;
  display: flex;
}

.pos-category-dropdown .dropdown-trigger {
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 0 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #fff;
  justify-content: space-between;
}

.pos-category-dropdown .dropdown-label {
  color: var(--ink);
}

.pos-category-dropdown .dropdown-menu {
  left: 0;
  right: auto;
  width: 100%;
  min-width: 100%;
}

.pos-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  min-height: 220px;
  width: 100%;
  display: grid;
  gap: 0.5rem;
  position: relative;
}

@media (min-width: 1281px) {
  .pos-card {
    max-width: 420px;
  }
}

@media (min-width: 1921px) {
  .pos-card {
    max-width: none;
  }
}

.pos-card.pos-card-skeleton {
  pointer-events: none;
}

.pos-card-skeleton-line,
.pos-card-skeleton-image,
.pos-card-skeleton-chip,
.pos-card-skeleton-btn,
.pos-card-skeleton-qty {
  background: linear-gradient(
    100deg,
    rgba(166, 166, 166, 0.24) 20%,
    rgba(210, 210, 210, 0.4) 45%,
    rgba(166, 166, 166, 0.24) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.pos-card-skeleton-image {
  height: 132px;
  border-radius: 20px;
}

.pos-card-skeleton-line {
  height: 18px;
  border-radius: 999px;
}

.pos-card-skeleton-line.title {
  width: 58%;
  height: 22px;
}

.pos-card-skeleton-line.price {
  width: 42%;
}

.pos-card-skeleton-chip {
  width: 88px;
  height: 28px;
  border-radius: 999px;
}

.pos-card-skeleton-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.pos-card-skeleton-qty {
  flex: 1;
  height: 52px;
  border-radius: 16px;
}

.pos-card-skeleton-btn {
  width: 100px;
  height: 52px;
  border-radius: 16px;
}

.pos-card.is-hidden {
  display: none;
}

.pos-editing .pos-card {
  cursor: grab;
}

.pos-card.is-dragging {
  opacity: 0.6;
  border-style: dashed;
}

.pos-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  border: 1px solid rgba(185, 28, 28, 0.4);
  background: #fff;
  color: #9b2c2c;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pos-editing .pos-card-delete {
  opacity: 1;
  pointer-events: auto;
}

.pos-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pos-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pos-info-card {
  display: grid;
  gap: 0.6rem;
  padding: 0 1rem 0.5rem;
  min-height: 0;
  align-content: start;
}

.pos-info-form {
  display: none;
}

#pos-info-image {
  width: 100%;
  max-width: 720px;
  height: min(28vh, 240px);
  overflow: hidden;
  border-radius: 12px;
  background: #f3f1ea;
  border: 1px dashed rgba(42, 34, 28, 0.2);
  display: grid;
  place-items: center;
  position: relative;
  justify-self: center;
  flex-shrink: 0;
}

.pos-info-form textarea {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  background: #fff;
  font-family: inherit;
  resize: vertical;
}

.pos-info-editing .pos-info-card {
  display: none;
}

.pos-info-editing .pos-info-form {
  display: grid;
}

.pos-info-save {
  display: none;
}

.pos-info-editing .pos-info-save {
  display: inline-flex;
}

.pos-info-editing .pos-dialog-edit {
  display: none;
}

.pos-info-editing .pos-card-actions {
  display: none;
}

#pos-info-dialog .account-dialog-inner {
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: calc(100dvh - 120px);
  overflow: hidden;
}

#pos-info-dialog .account-dialog-title {
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 2;
}

#pos-info-dialog .pos-dialog-edit,
#pos-info-dialog .pos-dialog-close {
  position: absolute;
  top: 12px;
  z-index: 3;
}

#pos-info-dialog .pos-dialog-close {
  right: 12px;
}

#pos-info-dialog .pos-dialog-edit {
  right: 52px;
}

#pos-info-dialog .pos-info-form,
#pos-info-dialog .pos-info-card {
  overflow-y: auto;
  padding-bottom: 1rem;
}

#pos-info-dialog .account-dialog-actions {
  position: sticky;
  bottom: 0;
  background: inherit;
  z-index: 2;
  padding-top: 0.5rem;
}

.pos-info-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.pos-info-code {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(42, 34, 28, 0.65);
}

.pos-info-barcode {
  min-height: 98px;
  border: 1px solid rgba(42, 34, 28, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 0.85rem 0.95rem 0.7rem;
  display: grid;
  place-items: center;
}

.pos-info-barcode.is-empty {
  color: rgba(42, 34, 28, 0.45);
  font-size: 0.85rem;
  text-align: center;
}

.pos-info-barcode svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  background: #fff;
}

.pos-info-barcode text {
  fill: #111827;
  font-family: "Arial", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
}

.pos-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.pos-payment-form {
  display: grid;
  gap: 0.85rem;
}

.pos-payment-options {
  display: grid;
  gap: 0.75rem;
}

.pos-payment-option {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.pos-payment-option.is-selected {
  border-color: #496f4b;
  background: rgba(73, 111, 75, 0.08);
  color: #27472c;
}

#pos-dialog .account-dialog-inner {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

@media (min-width: 641px) {
  #pos-dialog .account-dialog-inner {
    width: min(520px, 92vw);
    height: min(80vh, calc(100dvh - 120px));
    max-height: calc(100dvh - 120px);
  }
}

#pos-dialog .account-form {
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

#pos-dialog textarea {
  min-height: 56px;
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--stroke);
  resize: vertical;
}

#pos-dialog .pos-category-dropdown .dropdown-trigger,
#pos-info-dialog .pos-category-dropdown .dropdown-trigger {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0 0.9rem;
}

#pos-dialog .account-dialog-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  gap: 8px;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(42, 34, 28, 0.12);
}

#pos-dialog .account-dialog-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  min-height: 46px;
}

.pos-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: rgba(42, 34, 28, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pos-dialog-edit {
  position: absolute;
  top: 10px;
  right: 48px;
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: rgba(42, 34, 28, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pos-dialog-edit svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pos-dialog-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pos-card-image {
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: 12px;
  background: #f3f1ea;
  border: 1px dashed rgba(42, 34, 28, 0.2);
  display: grid;
  place-items: center;
  color: rgba(42, 34, 28, 0.5);
  font-size: 0.9rem;
  overflow: hidden;
  position: relative;
}

.pos-card-image.has-image,
#pos-info-image.has-image {
  border-style: solid;
  border-color: transparent;
  background: #fff;
}

.pos-card-image img,
#pos-info-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

.pos-card-image-icon {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pos-card-title {
  margin: 0;
  font-size: 1.05rem;
}

.pos-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pos-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(42, 34, 28, 0.18);
  font-size: 0.75rem;
  color: rgba(42, 34, 28, 0.75);
  background: #fff9f0;
}

.pos-card-price {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.pos-stock-hint {
  margin: -0.15rem 0 0;
  font-size: 0.82rem;
  color: rgba(42, 34, 28, 0.58);
}

.pos-card.is-out-of-stock .pos-stock-hint {
  color: #b91c1c;
}

.pos-image-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

#pos-image-input,
#pos-info-image-input {
  display: none;
}

.pos-upload {
  display: block;
  height: 140px;
  border: 1px dashed rgba(42, 34, 28, 0.25);
  border-radius: 14px;
  background: #fbfaf6;
  cursor: pointer;
  color: rgba(42, 34, 28, 0.7);
  text-align: center;
  padding-top: 20px;
}

.pos-upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(42, 34, 28, 0.2);
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto;
}

.pos-upload-text {
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

.pos-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.pos-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.35rem;
  background: #fff;
  justify-self: start;
}

.pos-qty-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(42, 34, 28, 0.2);
  background: #f9f6ef;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 700;
  font-family: inherit;
  -webkit-text-fill-color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
}

.pos-qty-value {
  min-width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.pos-add {
  height: 36px;
  padding: 0 1rem;
  background: #c0742a;
  border-color: #c0742a;
  color: #fff;
}
.pos-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--stroke);
  z-index: 20;
  padding: 0.75rem 1.5rem;
}

.footer-inner {
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 1rem;
}

.pos-footer-count {
  color: #6f6659;
  font-weight: 600;
}

.pos-footer-value {
  font-weight: 700;
  color: var(--ink);
}

.pos-footer-cta {
  height: 40px;
  padding: 0 1.2rem;
}

@media (max-width: 640px) {
  .pos-footer:not(.attendance-footer) .footer-inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .pos-footer:not(.attendance-footer) .pos-footer-cta {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

.attendance-page .layout {
  padding-bottom: 72px;
}

.attendance-footer .footer-inner {
  justify-content: flex-end;
}

.attendance-clock-time {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.history-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #4b5563;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.history-thumb:hover .history-thumb-remove,
.history-thumb:focus-within .history-thumb-remove {
  opacity: 1;
  pointer-events: auto;
}

.history-thumb-remove:hover {
  background: #dc2626;
  color: #fff;
}

.history-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(42, 34, 28, 0.6);
  font-size: 0.9rem;
}

.history-panel {
  position: fixed;
  top: var(--header-height, 68px);
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-left: 1px solid var(--stroke);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 21;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.history-panel.open {
  transform: translateX(0);
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0;
}

.history-panel-header h4 {
  margin: 0;
  line-height: 1;
}

.notification-panel {
  position: fixed;
  top: calc(var(--header-height, 68px) + 0.75rem);
  right: 1rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(72vh, 760px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(42, 34, 28, 0.1);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(18, 16, 12, 0.16);
  backdrop-filter: blur(14px);
  z-index: 34;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  display: grid;
  grid-template-rows: auto 1fr;
}

.notification-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(42, 34, 28, 0.08);
}

.notification-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.notification-panel-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.notification-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(42, 34, 28, 0.12);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.notification-panel-close:hover {
  background: rgba(42, 34, 28, 0.06);
}

.notification-panel-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.notification-panel-body {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.notification-panel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-tab {
  min-width: 54px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.9rem;
}

.notification-tab.is-active {
  background: rgba(192, 116, 42, 0.16);
  color: #c0742a;
}

.notification-section {
  display: grid;
  gap: 0.5rem;
}

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

.notification-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.notification-section h5 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.notification-section-link {
  border: none;
  background: transparent;
  color: #4e7fd3;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.notification-section-list {
  display: grid;
  gap: 0.25rem;
}

.notification-item {
  width: 100%;
  border: none;
  border-radius: 16px;
  background: transparent;
  padding: 0.875rem 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover {
  background: rgba(42, 34, 28, 0.05);
}

.notification-item-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.notification-item-label {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.notification-item-title {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
}

.notification-item-summary,
.notification-item-time {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.notification-item-side {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 0.35rem;
}

.notification-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #356fd2;
}

.notification-item-time {
  white-space: nowrap;
  align-self: end;
}

.notification-empty {
  margin: 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.notification-empty[hidden] {
  display: none !important;
}

@media (min-width: 1921px) {
  .btn.ghost.history-toggle:not(.rag-qa-toggle) {
    display: none;
  }

  .rag-qa-panel {
    width: 420px;
    transform: none;
    transition: none;
  }

  .history-panel {
    width: 420px;
    transform: none;
    transition: none;
  }

  .history-panel.open {
    transform: none;
  }

  .dashboard {
    left: 260px;
    right: 420px;
    width: auto;
  }

  .assistant-mode .assistant-input-wrap {
    left: 260px;
    right: 420px;
  }
}

@media (min-width: 1281px) {
}

@media (max-width: 1280px) {
  body.is-generating .generate-actions {
    grid-template-columns: 1fr 1fr;
  }

  body.is-generating .view-output {
    display: inline-flex;
  }

  body.has-output .view-output {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .notification-panel {
    top: calc(var(--header-height, 68px) + 0.5rem);
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: calc(100dvh - var(--header-height, 68px) - 1.25rem);
    border-radius: 18px;
  }

  .notification-item {
    padding-inline: 0.5rem;
  }
}

@media (max-width: 640px) {
  .account-dialog {
    position: fixed;
    top: var(--header-height, 68px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    z-index: 2000;
    opacity: 1;
  }

  .account-dialog[open] {
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .account-dialog-inner {
    border-radius: 18px 18px 0 0;
    height: auto;
    max-height: calc(100dvh - var(--header-height, 68px));
    width: 100% !important;
    max-width: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .account-dialog[open] .account-dialog-inner {
    animation: dialog-slide-up 0.28s ease;
  }

  .account-dialog.is-closing .account-dialog-inner {
    animation: dialog-slide-down 0.2s ease forwards;
  }

  @keyframes dialog-slide-up {
    from {
      transform: translateY(16px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes dialog-slide-down {
    from {
      transform: translateY(0);
      opacity: 1;
    }
    to {
      transform: translateY(16px);
      opacity: 0;
    }
  }
  .ai-dashboard .canvas-input {
    min-height: auto;
  }

  .ai-dashboard .prompt-card {
    min-height: auto;
  }

  .prompt-card-top {
    overflow: visible;
    flex: 0;
    min-height: auto;
  }

  .canvas-dialog {
    position: fixed;
    top: var(--header-height, 68px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    z-index: 2000;
  }

  .canvas-dialog[open] {
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: calc(100dvh - var(--header-height, 68px)) !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .canvas-dialog::backdrop {
    background: rgba(20, 16, 12, 0.5);
  }

  .canvas-dialog-inner {
    border-radius: 18px 18px 0 0;
    height: 100%;
    max-height: calc(100dvh - var(--header-height, 68px));
    align-self: end;
    width: 100% !important;
    max-width: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .prompt-dialog {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .prompt-dialog[open] {
    position: fixed;
    top: var(--header-height, 68px);
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(100dvh - var(--header-height, 68px)) !important;
    max-height: none !important;
    display: flex;
    opacity: 1 !important;
    transform: none !important;
  }

  .prompt-dialog::backdrop {
    background: rgba(20, 16, 12, 0.35) !important;
  }

  .prompt-dialog-inner {
    border-radius: 18px 18px 0 0 !important;
    height: 100% !important;
    max-height: none !important;
    width: 100%;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .prompt-dialog[open].is-open .prompt-dialog-inner {
    animation: dialog-slide-up 0.28s ease;
  }

  .prompt-dialog.is-closing .prompt-dialog-inner {
    animation: dialog-slide-down 0.2s ease forwards;
  }

  .prompt-dialog-scroll {
    overflow-y: auto;
  }
}

@media (max-width: 1280px) {
  .canvas-dialog {
    position: fixed;
    top: var(--header-height, 68px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    z-index: 2000;
  }

  .canvas-dialog[open] {
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: calc(100dvh - var(--header-height, 68px)) !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .canvas-dialog-inner {
    border-radius: 18px 18px 0 0;
    height: 100%;
    max-height: calc(100dvh - var(--header-height, 68px));
    align-self: end;
    width: 100% !important;
    max-width: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .canvas-dialog::backdrop {
    background: rgba(20, 16, 12, 0.5);
  }
}

body.is-generating .output-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

body.is-generating .stop-button {
  display: inline-flex;
  width: 100%;
}

#dialog-output-slot {
  width: 100%;
}

.canvas-output-dialog {
  border: none;
  background: transparent;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-output-dialog .output-top {
  flex: 1;
  min-height: 0;
}

.canvas-output-dialog .output-bottom {
  flex: 0 0 auto;
}

#dialog-output-slot .canvas-output,
#dialog-output-slot .output-top,
#dialog-output-slot #dialog-canvas-host,
#dialog-output-slot #dialog-canvas,
#dialog-output-slot .output-bottom {
  width: 100%;
  max-width: 100%;
}

#dialog-canvas-host {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

#dialog-canvas {
  width: 100%;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  display: block;
  background: #fff;
}

.ai-dashboard .canvas-input {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ai-dashboard .prompt-card {
  flex: 1;
  min-height: 0;
}

.ai-dashboard .prompt-area {
  min-height: 128px;
  max-height: 220px;
  font-size: 16px;
  resize: none;
  overflow-y: auto;
  margin: 0;
  padding: 0.75rem 5rem 2.75rem 0.75rem;
  border-radius: 20px;
  background: var(--field-bg);
  color: var(--text-primary);
}

.prompt-card-top {
  display: grid;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.prompt-card-bottom {
  display: grid;
  gap: 0;
  position: relative;
  z-index: 2;
}

.prompt-cards {
  display: grid;
  gap: 0.75rem;
}

.prompt-mini-card {
  border: 1px solid var(--stroke);
  padding: 0.75rem;
  background: var(--panel-elevated);
  overflow: visible;
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 3;
}

.prompt-card-header h4 {
  margin: 0;
  line-height: 1.1;
}

.prompt-card-header .info-button {
  margin-left: auto;
}

.tooltip-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  color: var(--muted);
  cursor: default;
  position: relative;
  z-index: 4;
  align-self: center;
  margin-bottom: 0.35rem;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 220px;
  max-width: 260px;
  transform: translateY(-4px);
  background: rgba(42, 34, 28, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.prompt-mini-card,
.theme-grid,
.theme-card {
  z-index: 1;
}

.tooltip-icon:hover::after {
  opacity: 1;
  transform: translateY(-8px);
}

.prompt-mini-card h4 {
  margin: 0 0 0.35rem;
}

.prompt-mini-card p {
  margin: 0;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow: visible;
}

.theme-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid var(--stroke);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  position: relative;
  min-height: 48px;
}

.theme-card input {
  margin: 0;
}

.theme-card input:checked + span {
  color: var(--accent);
  font-weight: 600;
}


.prompt-dialog {
  width: min(720px, 92vw);
  border: none;
  padding: 0;
  background: transparent;
  z-index: 30;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.prompt-dialog::backdrop {
  background: rgba(20, 16, 12, 0.35);
}

.prompt-dialog-inner {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-rows: auto 1fr auto;
  max-height: 80vh;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.prompt-dialog[open] {
  opacity: 0;
  transform: scale(0.96);
  height: 80vh;
}

.prompt-dialog[open].is-open {
  opacity: 1;
  transform: scale(1);
}

.prompt-tabs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 0;
  flex-wrap: nowrap;
}

.prompt-tab {
  border: 1px solid var(--stroke);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  height: fit-content;
}

.prompt-tab.prompt-tab-add {
  border: 1px dashed rgba(42, 34, 28, 0.35);
  background: #f7f2e8;
  color: rgba(42, 34, 28, 0.7);
}

.prompt-tab.active {
  border-color: rgba(192, 122, 42, 0.4);
  color: var(--accent);
}

.prompt-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  padding: 0.75rem 1rem 0.5rem;
  z-index: 3;
  height: fit-content;
}

.prompt-dialog-more {
  border: 1px solid var(--stroke);
  background: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  height: 48px;
  width: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prompt-dialog-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(42, 34, 28, 0.12);
  padding: 6px;
  display: grid;
  gap: 0;
  z-index: 10;
  min-width: 120px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.prompt-dialog-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

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

.prompt-dialog-menu-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.prompt-dialog-menu-item:hover {
  background: rgba(192, 116, 42, 0.1);
}

.prompt-dialog-menu-item[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.prompt-dialog-title {
  display: grid;
  gap: 0.5rem;
  overflow: visible;
  clip-path: none;
}

.prompt-dialog-title h3 {
  color: var(--ink);
  font-weight: 700;
}

.prompt-dialog-close {
  align-self: start;
  width: 24px;
  height: 24px;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: rgba(42, 34, 28, 0.7);
}

.prompt-dialog-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompt-dialog-scroll {
  overflow: auto;
  min-height: 0;
  padding: 0 1rem;
}

.prompt-dialog-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 0 0 1.25rem;
  align-self: start;
  min-height: 0;
}

.prompt-dialog-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  z-index: 2;
  overflow: visible;
}

.prompt-dialog-edit {
  height: 48px;
  padding: 0 18px;
}

.prompt-dialog-save,
.prompt-dialog-cancel {
  height: 48px;
  padding: 0 18px;
  display: none;
}


.prompt-dialog.is-editing .prompt-dialog-edit {
  display: none;
}

.prompt-dialog.is-editing .prompt-dialog-save,
.prompt-dialog.is-editing .prompt-dialog-cancel {
  display: inline-flex;
}

.prompt-dialog-editor {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  margin: 0;
  overflow: auto;
  height: 100%;
  flex: 1;
}

.prompt-rename-dialog,
.prompt-delete-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(360px, 90vw);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.prompt-rename-dialog[open],
.prompt-delete-dialog[open] {
  opacity: 1;
  transform: scale(1);
}

.prompt-rename-form,
.prompt-delete-form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.prompt-rename-form h4,
.prompt-delete-form h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
}

.prompt-rename-form input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.prompt-rename-actions,
.prompt-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.prompt-rename-actions .btn {
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
}

.prompt-rename-actions .btn.cta {
  border: none;
  background: var(--accent);
  color: #fff;
}

.btn.danger {
  background: #dc2626;
  color: #fff;
  border: none;
}

.account-dialog .btn.danger {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #fff;
}

.account-dialog .btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

#account-delete-dialog .btn.danger,
.account-table .account-delete {
  background: #c07a2a;
  border-color: #c07a2a;
  color: #fff;
}

#account-delete-dialog .btn.danger:hover,
.account-table .account-delete:hover {
  background: #a7661e;
  border-color: #a7661e;
  color: #fff;
}

.prompt-dialog.is-editing .prompt-dialog-scroll {
  flex: 1;
  overflow: hidden;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.prompt-dialog-media {
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  height: 150px !important;
  min-height: 150px;
  max-height: 150px;
  box-sizing: border-box;
  margin-bottom: 1rem;
  scroll-padding-left: 1rem;
  scroll-padding-right: 1rem;
}

.prompt-dialog-image-slot {
  --media-ratio: 1 / 1;
  aspect-ratio: var(--media-ratio);
  height: 100%;
  width: auto;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(42, 34, 28, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.prompt-dialog-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.prompt-dialog-image-add {
  border: 1.5px dashed rgba(42, 34, 28, 0.35);
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.prompt-dialog-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(42, 34, 28, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: #3D3D3D;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.prompt-dialog-image-slot:hover .prompt-dialog-image-remove {
  opacity: 1;
  pointer-events: auto;
}

.prompt-dialog-image-input {
  display: none;
}

@media (max-width: 640px) {
  .canvas-dialog,
  .prompt-dialog,
  .prompt-rename-dialog,
  .prompt-delete-dialog {
    transform: translateY(16px);
  }

  .canvas-dialog[open],
  .prompt-dialog[open].is-open,
  .prompt-rename-dialog[open],
  .prompt-delete-dialog[open] {
    transform: translateY(0);
  }

  .prompt-rename-dialog,
  .prompt-delete-dialog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0;
  }

  .prompt-rename-dialog[open],
  .prompt-delete-dialog[open] {
    display: block;
  }

  .prompt-rename-form,
  .prompt-delete-form {
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }

  .prompt-dialog-body {
    align-self: stretch;
    padding-top: 0;
  }
}

.prompt-area {
  width: 100%;
  border: 1px solid var(--stroke);
  box-sizing: border-box;
  padding: 0.9rem 5rem 2.75rem 0.9rem;
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.5;
  scrollbar-gutter: stable;
  background: var(--field-bg);
  color: var(--text-primary);
}

.prompt-input-wrap {
  position: relative;
}

.prompt-area::placeholder {
  color: #aaa39b;
}

.prompt-area-image-add {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prompt-area-image-add svg {
  width: 18px;
  height: 18px;
}

.prompt-input-wrap .prompt-select-wrap {
  position: absolute;
  left: 3.2rem;
  bottom: 0.75rem;
  z-index: 2;
}

.prompt-input-wrap .prompt-select-wrap .dropdown-trigger {
  min-height: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0 10px;
}

.prompt-generate-round {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #4b6f4b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prompt-generate-round svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
}

.prompt-generate-round .icon-stop {
  display: none;
}

.prompt-generate-round.is-generating {
  background: #9ca3af;
}

.prompt-generate-round.is-generating .icon-send {
  display: none;
}

.prompt-generate-round.is-generating .icon-stop {
  display: block;
}

.prompt-area-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.prompt-area-upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #d9d4ca;
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  color: #3d3d3d;
}

.prompt-area-upload-chip button {
  border: none;
  background: transparent;
  color: #8e8881;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.prompt-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-select {
  display: none;
}

.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown select {
  display: none;
}

.dropdown-trigger {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  min-height: 40px;
  height: 40px;
}

.dropdown-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.dropdown-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(42, 34, 28, 0.55);
  border-bottom: 2px solid rgba(42, 34, 28, 0.55);
  transform: rotate(45deg);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(42, 34, 28, 0.12);
  padding: 6px;
  min-width: 160px;
  max-height: min(280px, 40vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: none;
  z-index: 10;
  gap: 6px;
}

.dropdown-menu.is-open {
  display: grid;
}

.dropdown-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.dropdown-item:hover {
  background: rgba(192, 116, 42, 0.1);
}

.dropdown-item.is-active {
  color: #c0742a;
}

/* iOS Safari: prevent default blue text on clickable tabs/dropdowns */
.ai-tab,
.prompt-tab,
.dropdown-trigger,
.dropdown-item,
.home-tool-menu-item {
  color: #3D3D3D !important;
  -webkit-text-fill-color: #3D3D3D;
}

.ai-tab.is-active,
.prompt-tab.active,
.dropdown-item.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a;
}

button,
[role="tab"],
[role="menuitem"] {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.prompt-select-wrap .dropdown-trigger {
  border: 1px solid var(--stroke);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  background: var(--field-bg);
  color: var(--text-primary);
  border-radius: 8px;
  min-height: auto;
}

.prompt-select-wrap .dropdown-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.attendance-filter-all .attendance-filter-select-wrap {
  min-width: 0;
}

.attendance-filter-select-wrap .dropdown-trigger {
  border: 1px solid rgba(42, 34, 28, 0.18);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  height: 40px;
  justify-content: space-between;
  min-width: 160px;
  width: 100%;
}

.attendance-filter-select-wrap .dropdown-menu {
  left: 0;
  right: auto;
  min-width: 100%;
}

.account-sort-dropdown .dropdown-trigger {
  font-size: 16px;
  padding: 0.45rem 0.2rem;
  width: 100%;
  justify-content: space-between;
  background: transparent !important;
}

.account-sort-dropdown {
  width: 100%;
}

.account-sort-dropdown .dropdown-menu {
  width: 100%;
  min-width: 100%;
  right: 0;
  left: 0;
}

.prompt-controls .btn {
  padding: 6px 10px;
  font-size: 0.9rem;
}

.text-button {
  background: transparent;
  border: none;
  padding: 0;
  color: #496F4B;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: auto;
}

.prompt-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.prompt-input {
  width: 100%;
  border: 1px solid var(--stroke);
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
}

@media (max-width: 1280px) {
  .dashboard,
  .ci-dashboard,
  .ai-dashboard {
    padding: 1rem;
  }

  .ai-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }

  .attendance-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }

  .inventory-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }

  .rag-admin-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }


  .canvas-panel {
    grid-template-columns: 1fr;
  }

  .canvas-input,
  .canvas-output {
    width: 100%;
  }

  .ai-tabs {
    display: flex;
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    padding: 0;
    background: var(--panel-elevated);
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 5;
    gap: 0.5rem;
    margin: 0;
  }

  .attendance-tabs {
    display: flex;
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    padding: 0;
    background: rgba(248, 245, 240, 0.95);
    backdrop-filter: blur(6px);
    z-index: 5;
    gap: 0;
    margin: 0;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .attendance-tab {
    flex: 1 1 0;
    text-align: center;
    font-size: 0.9rem;
    padding: 1rem 0.9rem;
    font-weight: 900;
    position: relative;
    white-space: nowrap;
  }

  .attendance-tab.is-active {
    color: #7a4a1e;
  }

  .attendance-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #7a4a1e;
    border-radius: 2px;
  }

  .attendance-tab-divider {
    display: none;
    flex: 0 0 auto;
    width: 1px;
    height: 16px;
    background: rgba(42, 34, 28, 0.25);
  }

  .rag-drive-tabs {
    display: flex;
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    padding: 0;
    background: #f8f5f0;
    z-index: 95;
    gap: 0;
    margin: 0;
    align-items: center;
    border-bottom: 1px solid rgba(42, 34, 28, 0.12);
  }

  .rag-drive-controls {
    padding-top: 0;
  }

  .rag-drive-tabs .ai-tab {
    flex: 1;
    text-align: center;
    font-family: "Noto Sans TC", "Metropolis", sans-serif !important;
    font-size: 0.9rem;
    padding: 1rem 0;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
    background: transparent;
    border-radius: 0;
    position: relative;
  }

  .rag-drive-tabs .ai-tab.is-active {
    color: var(--accent);
  }

  .rag-drive-tabs .ai-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
  }

  .rag-drive-tab-divider {
    display: none;
    width: 1px;
    height: 20px;
    flex: 0 0 1px;
    background: rgba(42, 34, 28, 0.2);
  }

  .history-panel {
    z-index: 21;
  }

  .account-tabs {
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    padding: 0.65rem 1.5rem;
    background: rgba(248, 245, 240, 0.95);
    backdrop-filter: blur(6px);
    z-index: 5;
  }

  .account-card {
    width: 100%;
  }

  .account-tab {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    position: relative;
  }

  .account-tab + .account-tab {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }

  .account-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.2rem;
    height: 2px;
    background: #7a4a1e;
    border-radius: 2px;
  }

  .tab-panel {
    display: none;
  }

  .tab-panel.is-active {
    display: block;
  }

  #canvas-output-slot {
    display: none;
  }

  #canvas-output-slot.tab-panel.is-active {
    display: block;
  }

  .canvas-output {
    border: none;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
  }

  .output-top,
  .output-top.has-tags,
  #canvas-host {
    height: 100%;
  }

  #canvas-host {
    background: var(--panel-bg);
  }

  .prompt-card {
    padding-bottom: 36px;
  }

  .canvas-empty {
    display: none;
  }

  .view-output {
    display: none !important;
  }

  body.ai-tab-output .prompt-card-bottom {
    display: none !important;
  }

  body.ai-tab-output .prompt-card-top,
  body.ai-tab-output .prompt-cards {
    display: none !important;
  }

  body.ai-tab-output .canvas-input {
    display: none !important;
  }

  .canvas-dialog,
  .prompt-dialog,
  .prompt-rename-dialog,
  .prompt-delete-dialog {
    height: calc(100vh - var(--header-height, 68px));
    max-height: calc(100vh - var(--header-height, 68px));
  }

  .canvas-dialog-inner,
  .prompt-dialog-inner {
    height: 100%;
    max-height: 100%;
  }

  .prompt-dialog-scroll {
    max-height: 100%;
  }

  #dialog-audit-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #dialog-audit-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .history-toggle {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

@media (max-width: 640px) {
  .dashboard,
  .ci-dashboard,
  .ai-dashboard {
    padding: 1rem;
  }

  .prompt-card {
    padding-bottom: 36px;
  }

  .ai-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }

  .rag-admin-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }
}
.timeline {
  background: var(--card);
  border-radius: 24px;
  padding: 22px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  pointer-events: none;
}

.home-tool-panel {
  box-shadow: none;
  pointer-events: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.home-tool-panel.is-hidden {
  display: none;
}

.home-tool-card.is-hidden,
.home-tool-empty.is-hidden,
.home-tool-edit-btn.is-hidden,
.home-tool-add-btn.is-hidden {
  display: none;
}

.home-tools {
  border-radius: 24px;
  padding: 0;
  border: none;
  box-shadow: none;
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  align-self: stretch;
  display: grid;
  justify-items: center;
}

.home-quick-links {
  max-width: 900px;
  width: 100%;
  margin: 0 auto 1.5rem;
  display: grid;
  gap: 1rem;
  padding: 12px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(42, 34, 28, 0.08);
  box-shadow: 0 16px 32px rgba(42, 34, 28, 0.08);
}

.home-quick-links-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.home-quick-links-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}

.home-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1rem;
}

.home-quick-links-skeleton {
  grid-column: 1 / -1;
  height: 108px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(233, 227, 217, 0.8) 0%,
    rgba(245, 240, 232, 0.95) 50%,
    rgba(233, 227, 217, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.home-quick-links-edit {
  flex: 0 0 auto;
}

.home-quick-links-edit,
.home-tool-more {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(42, 34, 28, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.home-quick-links-edit {
  position: relative;
  z-index: 1;
}

.home-quick-links-edit:hover,
.home-tool-more:hover {
  background: var(--hover-bg);
  border-color: rgba(42, 34, 28, 0.32);
  transform: none;
}

.home-quick-links-edit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-quick-link-item {
  min-height: 108px;
  padding: 0.5rem 0.35rem;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 160ms ease;
}

.home-quick-link-item:hover {
  transform: translateY(-2px);
}

.home-quick-link-icon {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(192, 116, 42, 0.18), rgba(96, 140, 114, 0.26));
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.home-quick-link-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  stroke: currentColor;
}

.home-quick-link-label {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  justify-items: stretch;
  align-items: stretch;
  grid-auto-rows: 200px;
}

.home-tool-card--large {
  grid-row: span 2;
}

.home-tool-card--xlarge {
  grid-row: span 3;
}

@media (max-width: 960px) {
  .home-quick-links-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-quick-links {
    margin-bottom: 1.25rem;
    padding: 12px 16px;
  }

  .home-quick-links-head {
    gap: 0.75rem;
  }

  .home-quick-links-grid {
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-quick-link-item {
    min-height: 96px;
  }

  .home-quick-link-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .home-quick-link-label {
    font-size: 0.85rem;
  }
}

.home-tools-grid.is-empty {
  display: flex;
  justify-content: center;
}

.home-tools-grid.is-loading {
  display: grid;
}

.home-tool-empty {
  border-radius: 18px;
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 0;
  color: rgba(42, 34, 28, 0.5);
  font-weight: 600;
  border: 1px dashed rgba(42, 34, 28, 0.28);
  width: 100%;
  justify-self: stretch;
  background: transparent;
  cursor: pointer;
  padding: 2rem;
  text-align: center;
}

.home-tool-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(42, 34, 28, 0.2);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.home-tool-empty-text {
  font-size: 1rem;
}

.home-tool-card {
  background: #f4efe6;
  border: none;
  border-radius: 18px;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
  padding: 12px 16px;
  width: 100%;
  justify-self: stretch;
}

.home-tool-loading-card {
  display: block;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.home-tools.is-editing .home-tool-card {
  cursor: grab;
}

.home-tools.is-editing .home-tool-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.home-tools.is-editing .home-tool-card > * {
  pointer-events: none;
}

.home-tools.is-editing .home-tool-menu-wrap,
.home-tools.is-editing .home-tool-menu-wrap * {
  pointer-events: auto;
}

.home-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  position: static;
  background: transparent;
  border: none;
  padding: 0;
  width: auto;
  z-index: auto;
}

.home-tool-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
}

.home-tool-menu-wrap {
  position: relative;
  display: none;
}

.home-tool-more {
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.home-tools.is-editing .home-tool-menu-wrap {
  display: inline-flex;
}

.home-tool-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(42, 34, 28, 0.12);
  padding: 6px;
  min-width: 120px;
  display: none;
  z-index: 5;
}

.home-tool-menu.is-open {
  display: grid;
}

.home-tool-menu-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.home-tool-menu-item:hover {
  background: rgba(192, 116, 42, 0.1);
}

.home-tool-menu-item[data-tool-remove] {
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
}

.home-tool-menu-item[data-tool-remove]:hover {
  background: rgba(208, 122, 122, 0.12);
}

.home-tool-card .history-preview {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100px;
  grid-template-rows: 100px;
  justify-content: start;
  column-gap: 1rem;
  row-gap: 0;
  max-height: 100px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.home-tool-card .history-preview.is-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: none;
  min-height: 100px;
}

.home-tool-card .history-preview-item {
  overflow: hidden;
}

.home-tool-body {
  display: grid;
  gap: 0.6rem;
  min-height: 0;
}

.home-tool-list,
.home-tool-summary-list {
  display: grid;
  gap: 0.75rem;
  min-height: 0;
}

#home-tool-schedule .home-tool-list {
  display: flex;
  align-items: stretch;
  align-content: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

#home-tool-schedule.home-tool-card--large .home-tool-list,
#home-tool-schedule.home-tool-card--xlarge .home-tool-list {
  display: block;
  overflow: hidden;
}

#home-tool-schedule .home-tool-list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.home-tool-card-skeleton-fill {
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(233, 227, 217, 0.8) 0%,
    rgba(245, 240, 232, 0.95) 50%,
    rgba(233, 227, 217, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.home-tool-list-item.is-skeleton {
  align-items: flex-start;
}

.home-tool-skeleton-line.title {
  width: 62%;
}

.home-tool-skeleton-line.meta {
  width: 38%;
}

.home-tool-skeleton-line.value {
  width: 56px;
}

.home-tool-list-item,
.home-tool-summary-row {
  display: grid;
  gap: 0.2rem;
  height: auto;
  min-height: 0;
  align-self: start;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(42, 34, 28, 0.12);
}

#home-tool-schedule .home-tool-list-item,
#home-tool-leave .home-tool-list-item,
#home-tool-lodging .home-tool-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: auto;
}

.home-tool-schedule-tile {
  display: grid;
  align-content: start;
  flex: 0 0 132px;
  gap: 0.75rem;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0.9rem;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.home-tool-schedule-tile.is-today {
  border-color: rgba(196, 122, 36, 0.58);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 36, 0.18);
}

.home-tool-schedule-tile.is-skeleton {
  align-content: start;
}

.home-tool-schedule-date {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.home-tool-schedule-pill-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.home-tool-schedule-pill {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tool-schedule-pill.schedule-member-badge {
  width: auto;
  min-height: 0;
}

.home-tool-schedule-calendar {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.5rem;
  min-height: 0;
  height: 100%;
}

.home-tool-schedule-large-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 0;
  height: 100%;
}

.home-tool-schedule-aside {
  min-width: 0;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.home-tool-schedule-aside-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0.45rem;
  overflow: visible;
}

.home-tool-schedule-aside-list.is-scrollable {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.home-tool-schedule-aside-item {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
  padding: 0.45rem;
  border: 1px solid rgba(42, 34, 28, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.home-tool-schedule-aside-item.is-today {
  border-color: rgba(196, 122, 36, 0.58);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 36, 0.18);
}

.home-tool-schedule-aside-date {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.home-tool-schedule-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.home-tool-schedule-weekday {
  min-width: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(42, 34, 28, 0.66);
}

.home-tool-schedule-weekday.is-weekend {
  color: #c74a4a;
}

.home-tool-schedule-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  min-height: 0;
  height: 100%;
  grid-auto-rows: minmax(0, 1fr);
}

.home-tool-schedule-calendar-cell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.24rem;
  padding: 0.3rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
}

.home-tool-schedule-calendar-cell.is-empty {
  background: transparent;
  border-color: transparent;
}

.home-tool-schedule-calendar-cell.is-today {
  border-color: rgba(196, 122, 36, 0.58);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 36, 0.18);
  border: 1px solid rgba(196, 122, 36, 0.58);
  background: rgba(255, 248, 238, 0.92);
}

.home-tool-schedule-calendar-cell.is-skeleton {
  padding-top: 0.55rem;
  align-content: start;
}

.home-tool-schedule-calendar-day {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  justify-self: center;
}

.home-tool-schedule-calendar-cell.has-event .home-tool-schedule-calendar-day {
  color: #b42318;
}

.home-tool-schedule-event-chip {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
  font-size: 0.6rem;
  padding: 0.05rem 0.28rem;
  border-radius: 99px;
  font-weight: 500;
  line-height: 1.4;
}


.home-tool-schedule-more-pill {
  background: rgba(42, 34, 28, 0.08);
  color: rgba(42, 34, 28, 0.72);
}

.home-tool-card--large .home-tool-schedule-pill-grid,
.home-tool-card--xlarge .home-tool-schedule-pill-grid {
  gap: 0.3rem;
}

.home-tool-card--large .home-tool-schedule-calendar-grid {
  gap: 0;
}

.home-tool-card--xlarge .home-tool-schedule-calendar-grid {
  gap: 0.35rem;
}

.home-tool-card--xlarge .home-tool-schedule-calendar-cell {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(42, 34, 28, 0.08);
}

.home-tool-card--large .home-tool-schedule-calendar-cell .home-tool-schedule-pill-grid,
.home-tool-card--xlarge .home-tool-schedule-calendar-cell .home-tool-schedule-pill-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 0.28rem;
}

.home-tool-card--large .home-tool-schedule-calendar-cell .home-tool-schedule-pill,
.home-tool-card--xlarge .home-tool-schedule-calendar-cell .home-tool-schedule-pill {
  min-height: 0;
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
}

.home-tool-card--large .home-tool-schedule-aside-item .home-tool-schedule-pill,
.home-tool-card--xlarge .home-tool-schedule-aside-item .home-tool-schedule-pill {
  padding: 0.26rem 0.6rem;
  font-size: 0.76rem;
  border-radius: 999px;
  width: auto;
  min-width: auto;
  height: auto;
  min-height: auto;
}

.home-tool-card--large .home-tool-schedule-calendar-cell .home-tool-schedule-pill,
.home-tool-card--xlarge .home-tool-schedule-calendar-cell .home-tool-schedule-pill {
  width: 12px;
  min-width: 12px;
  height: 12px;
  min-height: 12px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  background: currentColor;
  border: 1px solid currentColor;
  opacity: 1;
  overflow: hidden;
  text-indent: -9999px;
  white-space: nowrap;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-1,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-2,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-3,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-4,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-5,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-6,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-7,
html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-8,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-1,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-2,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-3,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-4,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-5,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-6,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-7,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-8 {
  border-width: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-1,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-1 {
  background: #5da9ff;
  color: #5da9ff;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-2,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-2 {
  background: #4fd18b;
  color: #4fd18b;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-3,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-3 {
  background: #ffb454;
  color: #ffb454;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-4,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-4 {
  background: #c68cff;
  color: #c68cff;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-5,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-5 {
  background: #ff7f96;
  color: #ff7f96;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-6,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-6 {
  background: #42d4d6;
  color: #42d4d6;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-7,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-7 {
  background: #ffd84d;
  color: #ffd84d;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell .schedule-member-badge-8,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell .schedule-member-badge-8 {
  background: #c7d2e0;
  color: #c7d2e0;
}

.home-tool-card--large .home-tool-schedule-calendar-cell .home-tool-schedule-more-pill,
.home-tool-card--xlarge .home-tool-schedule-calendar-cell .home-tool-schedule-more-pill {
  width: auto;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 18px;
}

@media (max-width: 640px) {
  .home-tool-schedule-large-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .home-tool-schedule-aside-list {
    grid-template-columns: 1fr;
  }

  .home-tool-card--large .home-tool-schedule-calendar-cell .home-tool-schedule-pill-grid,
  .home-tool-card--xlarge .home-tool-schedule-calendar-cell .home-tool-schedule-pill-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 0.22rem;
  }

  .home-tool-card--large .home-tool-schedule-aside,
  .home-tool-card--xlarge .home-tool-schedule-aside {
    overflow: hidden;
    min-height: 0;
    height: auto;
  }

  .home-tool-card--large .home-tool-schedule-aside-list,
  .home-tool-card--xlarge .home-tool-schedule-aside-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    grid-template-columns: unset;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .home-tool-card--large .home-tool-schedule-aside-item,
  .home-tool-card--xlarge .home-tool-schedule-aside-item {
    display: grid;
    align-content: start;
    flex: 0 0 120px;
    gap: 0.75rem;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0.9rem;
    border-radius: 14px;
  }

  .home-tool-card--large .home-tool-schedule-aside-date,
  .home-tool-card--xlarge .home-tool-schedule-aside-date {
    font-size: 0.95rem;
  }

  .home-tool-card--large .home-tool-schedule-aside-list .home-tool-schedule-pill,
  .home-tool-card--xlarge .home-tool-schedule-aside-list .home-tool-schedule-pill {
    width: auto;
    min-width: auto;
    height: auto;
    min-height: auto;
    padding: 0.26rem 0.6rem;
    border-radius: 999px;
    opacity: 1;
    overflow: visible;
    text-indent: 0;
    white-space: nowrap;
    font-size: 0.76rem;
    line-height: normal;
  }
}

.home-tool-list-item:last-child,
.home-tool-summary-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.home-tool-list-title,
.home-tool-summary-label {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.home-tool-list-meta,
.home-tool-summary-value {
  color: rgba(42, 34, 28, 0.72);
  font-size: 0.95rem;
}

#home-tool-schedule .home-tool-list-title,
#home-tool-leave .home-tool-list-title,
#home-tool-lodging .home-tool-list-title {
  min-width: 0;
}

#home-tool-schedule .home-tool-list-meta,
#home-tool-leave .home-tool-list-meta,
#home-tool-lodging .home-tool-list-meta {
  text-align: right;
  justify-self: end;
  margin-left: auto;
  white-space: nowrap;
}

.home-tool-list-empty,
.home-tool-list-more {
  margin: 0;
  color: rgba(42, 34, 28, 0.58);
  font-size: 0.95rem;
}

#home-tool-inventory .home-tool-summary-list {
  display: flex;
  justify-content: space-between;
  gap: 0;
}

#home-tool-inventory .home-tool-summary-row {
  display: grid;
  align-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  padding-bottom: 0;
  border-bottom: none;
}

#home-tool-inventory .home-tool-summary-row.is-skeleton {
  align-content: center;
}

#home-tool-inventory .home-tool-summary-label,
#home-tool-inventory .home-tool-summary-value {
  height: auto;
}

.home-tool-punch {
  justify-self: start;
  height: 36px;
  padding: 0 1rem;
  width: 100%;
}

.home-tool-punch.is-off {
  background: #496F4B;
  color: #fff;
}

.home-tool-punch.is-on {
  background: #c0742a;
  color: #fff;
}

.home-tool-punch:disabled,
.home-tool-punch-in:disabled,
.home-tool-punch-out:disabled,
.attendance-footer .btn:disabled,
.attendance-footer .cta:disabled {
  background: var(--btn-disabled-bg) !important;
  color: var(--btn-disabled-ink) !important;
  border-color: var(--btn-disabled-border) !important;
}

.home-tool-punch-row {
  display: flex;
  gap: 0.75rem;
}

.home-tool-punch-in {
  background: #496F4B;
  color: #fff;
}

.home-tool-punch-out {
  background: #c0742a;
  color: #fff;
}

.home-tool-times {
  display: flex;
  justify-content: space-between;
  gap: 0;
  font-size: 0.9rem;
  color: rgba(42, 34, 28, 0.8);
}

.home-tool-time-row {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.home-tool-time-label {
  color: rgba(42, 34, 28, 0.6);
}

.home-tool-time-value {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
}

.home-tool-total {
  font-size: 0.9rem;
  color: rgba(42, 34, 28, 0.7);
  font-variant-numeric: tabular-nums;
}

.attendance-dashboard {
  padding-bottom: 10rem;
}

.inventory-dashboard {
  padding: 0 2rem 2rem;
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

.inventory-tabs-row,
.inventory-panel.is-active {
  background: transparent !important;
}

.inventory-table-sticky-wrap {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.attendance-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0;
  box-shadow: none;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.attendance-mobile-list {
  display: none;
}

.performance-mobile-list,
.rag-mobile-list {
  display: none;
}

.attendance-mobile-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--card);
}

.attendance-mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rag-admin-page .attendance-mobile-card-head .rag-drive-more-wrap {
  margin-left: auto;
  flex: 0 0 auto;
}

.attendance-mobile-card-head h3,
.attendance-mobile-card-head p,
.attendance-mobile-card-note,
.attendance-mobile-card-meta p {
  margin: 0;
}

.attendance-mobile-card-head h3 {
  font-size: 1rem;
}

.attendance-mobile-card-head p,
.attendance-mobile-card-note,
.attendance-mobile-card-meta strong {
  color: var(--muted);
}

.attendance-mobile-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 0.9rem;
}

.attendance-mobile-card-meta p {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.rag-mobile-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: flex-start;
}

.rag-mobile-card-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 24px;
  margin-top: 0.1rem;
}

.rag-mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attendance-mobile-card-meta span {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.attendance-mobile-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.performance-skeleton-line {
  display: block;
  border-radius: 999px;
}

.performance-skeleton-line.kpi {
  width: 72px;
  height: 28px;
}

.performance-skeleton-line.table {
  width: 100%;
  height: 16px;
}

.performance-skeleton-menu {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(224, 214, 196, 0.35), rgba(244, 238, 227, 0.9), rgba(224, 214, 196, 0.35));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.performance-mobile-card-skeleton h3,
.performance-mobile-card-skeleton p,
.performance-mobile-card-skeleton strong,
.performance-mobile-card-skeleton span {
  color: transparent;
}

.attendance-mobile-empty {
  padding: 1rem 0;
}

.notification-skeleton-list {
  display: grid;
  gap: 0.9rem;
}

.notification-skeleton-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.notification-skeleton-copy,
.notification-skeleton-side {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.notification-skeleton-copy {
  flex: 1 1 auto;
}

.notification-skeleton-side {
  flex: 0 0 56px;
  justify-items: end;
}

.notification-skeleton-line {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(224, 214, 196, 0.35), rgba(244, 238, 227, 0.9), rgba(224, 214, 196, 0.35));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  height: 12px;
}

.notification-skeleton-line.label {
  width: 52px;
}

.notification-skeleton-line.title {
  width: 140px;
  height: 16px;
}

.notification-skeleton-line.summary {
  width: 100%;
}

.notification-skeleton-line.time {
  width: 40px;
}

.notification-skeleton-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(224, 214, 196, 0.35), rgba(244, 238, 227, 0.9), rgba(224, 214, 196, 0.35));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.attendance-title {
  margin: 0 0 12px;
  font-size: 20px;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.attendance-tabs {
  display: flex;
  gap: 0.75rem;
  max-width: none;
  margin: 0 0 12px;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.attendance-tab {
  cursor: pointer;
  margin: 0;
  width: auto;
  flex: 0 0 auto;
  color: #3D3D3D;
  font-family: "Metropolis", "Noto Sans TC", sans-serif !important;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 900;
}

.attendance-tab.is-active {
  color: #c0742a;
}

.attendance-tab-divider {
  width: 1px;
  height: 18px;
  background: rgba(42, 34, 28, 0.2);
}

.attendance-tabs {
  position: relative;
}

.attendance-tabs::before {
  content: none;
}

.attendance-panel {
  display: none;
}

.attendance-panel.is-active {
  display: block;
}

.attendance-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
}

.attendance-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-bottom: 8px;
}

.attendance-filter-range {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  align-items: center;
  width: auto;
  flex: 0 0 auto;
}

.attendance-filter-range.is-hidden {
  display: none;
}

.attendance-filter-range input {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(42, 34, 28, 0.18);
  font-size: 1rem;
}

@media (max-width: 640px) {
  .account-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .account-toolbar-filters {
    width: 100%;
  }

  .account-toolbar-filters .account-search-wrap,
  .account-toolbar-filters .account-sort-wrap,
  .account-toolbar-filters .account-sort-dropdown,
  .account-toolbar-filters .dropdown-trigger {
    width: 100%;
    min-width: 0;
  }

  .account-toolbar #account-add-button {
    width: 100%;
  }

  .attendance-filter-range {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
  }

  .attendance-filter-range input {
    width: 0;
    flex: 1 1 0;
    min-width: 0;
  }

  .attendance-filter-sep {
    align-self: center;
    flex: 0 0 auto;
  }

  .attendance-filter {
    overflow-x: visible;
  }

  .attendance-dashboard {
    overflow-x: visible;
  }

  .attendance-page .attendance-table-wrap,
  .leave-page .attendance-table-wrap,
  .performance-page .attendance-table-wrap,
  .promotion-page .attendance-table-wrap,
  .employee-accounts-page .account-table-wrap,
  .rag-admin-page .devtest-table-wrap {
    display: none;
  }

  .attendance-page .attendance-card,
  .leave-page .leave-card,
  .performance-page .attendance-card,
  .promotion-page .attendance-card,
  .employee-accounts-page .account-card,
  .rag-admin-page .dashboard {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .attendance-page .attendance-mobile-list,
  .leave-page .attendance-mobile-list,
  .performance-page .attendance-mobile-list,
  .promotion-page .attendance-mobile-list,
  .employee-accounts-page .attendance-mobile-list,
  .rag-admin-page .attendance-mobile-list {
    display: grid;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    overflow: hidden;
  }

  .employee-accounts-page .attendance-mobile-list,
  .employee-accounts-page .attendance-mobile-card,
  .rag-admin-page .attendance-mobile-list,
  .rag-admin-page .attendance-mobile-card {
    overflow: visible;
  }

  .attendance-page .attendance-mobile-card-meta,
  .leave-page .attendance-mobile-card-meta,
  .performance-page .attendance-mobile-card-meta,
  .promotion-page .attendance-mobile-card-meta,
  .employee-accounts-page .attendance-mobile-card-meta,
  .rag-admin-page .attendance-mobile-card-meta {
    grid-template-columns: 1fr;
  }

  .attendance-page .attendance-mobile-card,
  .leave-page .attendance-mobile-card,
  .performance-page .attendance-mobile-card,
  .promotion-page .attendance-mobile-card,
  .employee-accounts-page .attendance-mobile-card,
  .rag-admin-page .attendance-mobile-card {
    border: none;
    border-radius: 0;
    padding: 1rem;
    background: transparent;
  }

  .employee-accounts-page .attendance-mobile-card {
    position: relative;
  }

  .attendance-page .attendance-mobile-card + .attendance-mobile-card,
  .leave-page .attendance-mobile-card + .attendance-mobile-card,
  .performance-page .attendance-mobile-card + .attendance-mobile-card,
  .promotion-page .attendance-mobile-card + .attendance-mobile-card,
  .employee-accounts-page .attendance-mobile-card + .attendance-mobile-card,
  .rag-admin-page .attendance-mobile-card + .attendance-mobile-card {
    border-top: 1px solid rgba(42, 34, 28, 0.12);
  }

  .attendance-page .attendance-mobile-empty,
  .leave-page .attendance-mobile-empty,
  .performance-page .attendance-mobile-empty,
  .promotion-page .attendance-mobile-empty,
  .employee-accounts-page .attendance-mobile-empty,
  .rag-admin-page .attendance-mobile-empty {
    padding: 1rem;
  }
}

.attendance-filter-sep {
  color: rgba(42, 34, 28, 0.7);
  font-size: 0.9rem;
}

.attendance-filter-all {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-right: auto;
}

.attendance-filter-all.is-hidden {
  display: none;
}

.attendance-filter-all .dropdown-search {
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(42, 34, 28, 0.18);
  font-size: 1rem;
  width: 100%;
}

.dropdown-list {
  display: grid;
  gap: 0;
  max-height: 220px;
  overflow-y: auto;
}

.attendance-filter-quick {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.attendance-filter-btn {
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex: 0 0 auto;
}

.attendance-filter-btn.is-active {
  border-color: #c0742a;
  color: #c0742a;
}

.attendance-filter-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.attendance-filter-total {
  font-size: 0.95rem;
  color: rgba(42, 34, 28, 0.75);
  white-space: nowrap;
}

.attendance-export-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.attendance-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
}

.employee-accounts-page .account-card,
.employee-accounts-page .account-panel,
.employee-accounts-page .account-table-wrap {
  overflow: visible;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.attendance-table th,
.attendance-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(42, 34, 28, 0.12);
  font-size: 0.95rem;
}

.attendance-table th {
  background: #faf7f2;
  color: rgba(42, 34, 28, 0.7);
  font-weight: 600;
}

.attendance-table th + th {
  box-shadow: inset 1px 0 0 rgba(42, 34, 28, 0.08);
}

.attendance-table th:nth-last-child(2),
.attendance-table td:nth-last-child(2) {
  min-width: 148px;
  white-space: nowrap;
}

.attendance-table th:last-child,
.attendance-table td:last-child {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.attendance-empty {
  text-align: center;
  color: rgba(42, 34, 28, 0.5);
  padding: 24px 0;
}

html[data-theme="dark"] .attendance-empty {
  color: #9aa5b1;
}

.attendance-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.attendance-action-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attendance-action-trigger {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(42, 34, 28, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}

.attendance-action-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.attendance-action-dropdown {
  position: fixed;
  width: 168px;
  padding: 0.35rem;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(42, 34, 28, 0.16);
  box-sizing: border-box;
  display: none;
  z-index: 1200;
}

.attendance-action-dropdown.is-open {
  display: grid;
  gap: 0.2rem;
}

.attendance-action-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
  border: none !important;
  background: transparent;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.attendance-action-dropdown .attendance-edit:hover {
  background: rgba(42, 34, 28, 0.08);
}

.attendance-action-dropdown .attendance-delete:hover {
  background: rgba(220, 38, 38, 0.08);
}

.attendance-delete {
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.58) !important;
  background: transparent;
  gap: 0.35rem;
}

.attendance-edit {
  color: rgba(42, 34, 28, 0.82);
  border: 1px solid rgba(42, 34, 28, 0.3) !important;
  background: transparent;
  gap: 0.35rem;
}

.attendance-edit:hover {
  background: rgba(42, 34, 28, 0.08);
}

.attendance-delete:hover {
  background: rgba(220, 38, 38, 0.08);
}

.attendance-edit .rag-action-icon,
.attendance-delete .rag-action-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

html[data-theme="dark"] .attendance-action-trigger {
  background: #2a2f38;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .attendance-action-dropdown {
  background: #242a33;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .attendance-action-dropdown .btn {
  color: var(--ink);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .attendance-action-dropdown .btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .attendance-action-dropdown .attendance-delete {
  color: #f28b82;
}

html[data-theme="dark"] .attendance-action-dropdown .attendance-delete:hover {
  background: rgba(242, 139, 130, 0.12);
}

html[data-theme="dark"] .performance-action-trigger {
  background: #242a33;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .performance-action-trigger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .performance-action-dropdown {
  background: #242a33;
  border-color: var(--stroke);
  color: var(--ink);
}

html[data-theme="dark"] .performance-action-dropdown .btn {
  color: var(--ink);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .performance-action-dropdown .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .performance-action-dropdown .performance-delete {
  color: #f28b82 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .performance-action-dropdown .performance-delete:hover {
  background: rgba(242, 139, 130, 0.12);
}

html[data-theme="dark"] #performance-action-delete,
html[data-theme="dark"] #performance-action-delete:not(:disabled) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
  filter: none !important;
}

html[data-theme="dark"] #performance-action-delete:hover:not(:disabled) {
  background: rgba(242, 139, 130, 0.12) !important;
  border: none !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
  filter: none !important;
}

.attendance-makeup-error {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--danger-accent);
}

.leave-dashboard {
  padding: 0 2rem 2rem;
}

.performance-dashboard {
  padding: 0 2rem 2rem;
}

@media (min-width: 1281px) {
  .dashboard {
    padding-top: 2rem;
  }

  .dashboard-home {
    padding-top: 1.5rem;
  }

  .ci-dashboard,
  body.schedule-page .schedule-dashboard,
  .inventory-dashboard,
  .leave-dashboard,
  .performance-dashboard {
    padding-top: 1rem;
  }
}

@media (max-width: 1280px) {
  .performance-dashboard {
    padding: 1rem;
  }
}

.performance-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 12px;
}

.performance-page .performance-dashboard,
.performance-page .performance-toolbar,
.performance-page .attendance-filter.performance-filter {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.leave-page .attendance-filter.leave-filter {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.performance-page .attendance-card,
.performance-page .attendance-table-wrap {
  max-width: 100%;
}

.performance-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.performance-table {
  min-width: 1360px;
}

.performance-table th,
.performance-table td {
  white-space: nowrap;
}

.performance-table th:last-child,
.performance-table td:last-child {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.performance-qty {
  font-variant-numeric: tabular-nums;
}

.performance-action-column {
  text-align: left;
  vertical-align: middle;
}

.performance-action-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.performance-action-trigger {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(42, 34, 28, 0.16);
  background: #fff;
  color: rgba(42, 34, 28, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
}

.performance-action-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.performance-action-trigger:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: rgba(42, 34, 28, 0.32);
}

.performance-action-dropdown {
  position: fixed;
  width: 168px;
  padding: 0.35rem;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(42, 34, 28, 0.16);
  box-sizing: border-box;
  display: none;
  z-index: 1200;
}

.performance-action-dropdown.is-open {
  display: grid;
  gap: 0.2rem;
}

.performance-action-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
  border: none !important;
  background: transparent !important;
  color: rgba(42, 34, 28, 0.82);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  box-shadow: none !important;
}

.performance-action-dropdown .btn:hover:not(:disabled) {
  background: rgba(42, 34, 28, 0.08);
}

.performance-delete {
  color: #dc2626 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.performance-action-dropdown .performance-delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.08) !important;
}

#performance-action-delete,
#performance-action-delete:not(:disabled) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

#performance-action-delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.08) !important;
  border: none !important;
  box-shadow: none !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

.leave-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 12px;
}

.leave-panel {
  display: none;
}

.leave-panel.is-active {
  display: block;
}

.leave-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.leave-summary-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.35rem;
}

.leave-summary-label {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(42, 34, 28, 0.62);
}

.leave-summary-value {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.leave-table {
  min-width: 1080px;
}

.leave-table th {
  background: #faf7f2;
  color: var(--muted);
}

.leave-table th,
.leave-table td {
  white-space: nowrap;
}

.leave-note-cell {
  max-width: 240px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.leave-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid rgba(42, 34, 28, 0.22);
  color: rgba(42, 34, 28, 0.75);
  background: rgba(42, 34, 28, 0.06);
}

.leave-status-pill.is-submitted {
  color: #8a6d1d;
  border-color: rgba(138, 109, 29, 0.5);
  background: rgba(205, 162, 48, 0.12);
}

.leave-status-pill.is-cancelled {
  color: #8b5d5d;
  border-color: rgba(139, 93, 93, 0.45);
  background: rgba(139, 93, 93, 0.1);
}

.leave-status-pill.is-approved {
  color: #1c6b42;
  border-color: rgba(28, 107, 66, 0.42);
  background: rgba(28, 107, 66, 0.1);
}

.leave-status-pill.is-rejected {
  color: #8f2f2f;
  border-color: rgba(143, 47, 47, 0.42);
  background: rgba(143, 47, 47, 0.1);
}

.leave-actions {
  white-space: nowrap;
  vertical-align: middle;
}

.leave-actions .btn + .btn {
  margin-left: 0.45rem;
}

.leave-cancel {
  color: #111111;
  border: 1px solid rgba(17, 17, 17, 0.5) !important;
  background: transparent;
  gap: 0.35rem;
}

.leave-cancel:hover {
  color: #111111;
  background: rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.5) !important;
}

.leave-approve {
  color: #1c6b42;
  border: 1px solid rgba(28, 107, 66, 0.5) !important;
  background: transparent;
  gap: 0.35rem;
}

.leave-approve:hover {
  color: #1c6b42;
  background: rgba(28, 107, 66, 0.1);
  border-color: rgba(28, 107, 66, 0.5) !important;
}

.leave-reject {
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.5) !important;
  background: transparent;
  gap: 0.35rem;
}

.leave-reject:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.5) !important;
}

.leave-apply-inner {
  max-width: 560px;
}

.leave-apply-form {
  gap: 0.9rem;
}

.leave-mode-group {
  border: 1px solid rgba(42, 34, 28, 0.14);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.leave-mode-group legend {
  padding: 0 0.2rem;
  font-size: 0.9rem;
  color: rgba(42, 34, 28, 0.72);
}

.leave-mode-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.leave-time-fields {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}

.leave-time-fields.is-hidden {
  display: none;
}

.leave-type-dropdown {
  width: 100%;
  min-width: 0;
}

.leave-type-dropdown .dropdown-menu {
  width: 100%;
  min-width: 100%;
  left: 0;
  right: 0;
}

.account-role-dropdown .dropdown-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

#account-dialog .dropdown.account-role-dropdown .dropdown-menu,
#account-edit-dialog .dropdown.account-role-dropdown .dropdown-menu,
#schedule-create-dialog .dropdown.account-role-dropdown .dropdown-menu {
  top: calc(100% + 6px) !important;
  bottom: auto !important;
  left: 0;
  right: 0;
  width: 100%;
  min-width: 100%;
  z-index: 20;
  max-height: min(280px, 40vh);
  overflow-y: auto;
}

#schedule-create-dialog .dropdown.account-role-dropdown .dropdown-menu {
  max-height: min(220px, calc(100dvh - 320px));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.account-permissions-group {
  margin: 0;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  padding: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.account-permissions-group legend {
  padding: 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(42, 34, 28, 0.78);
}

.account-permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.account-permission-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid rgba(42, 34, 28, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(42, 34, 28, 0.84);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  padding: 0.75rem;
}

.account-permission-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.account-permission-chip:has(input:checked) {
  border-color: rgba(196, 122, 36, 0.7);
  background: rgba(247, 226, 192, 0.56);
  color: #9b5d17;
}

.account-permission-chip:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.8;
}

.account-capabilities-group {
  margin-top: -0.2rem;
}

html[data-theme="dark"] .account-permissions-group {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(18, 22, 29, 0.35);
}

html[data-theme="dark"] .account-permissions-group legend {
  color: rgba(226, 232, 240, 0.82);
}

html[data-theme="dark"] .account-permission-chip {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(34, 40, 49, 0.92);
  color: #e7edf6;
}

html[data-theme="dark"] .account-permission-chip:has(input:checked) {
  border-color: rgba(214, 152, 74, 0.7);
  background: rgba(214, 152, 74, 0.18);
  color: #f3c98e;
}

.leave-apply-form textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  resize: vertical;
}

.leave-apply-hint {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(42, 34, 28, 0.65);
  line-height: 1.5;
}

.leave-footer-note {
  margin: 0.85rem 0 0;
  line-height: 1.6;
  color: rgba(42, 34, 28, 0.78);
}

.leave-footer-note > p {
  margin: 0;
}

.leave-footer-note-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.leave-footer-note-list li + li {
  margin-top: 0.2rem;
}

@media (min-width: 641px) {
  .leave-summary-card {
    max-width: 320px;
  }

  .leave-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .leave-toolbar #leave-apply-button {
    justify-self: end;
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .performance-page .performance-dashboard,
  .performance-page .performance-toolbar,
  .performance-page .attendance-filter.performance-filter {
    overflow-x: hidden;
  }

  .performance-page .attendance-card {
    width: 100%;
    max-width: 100%;
  }

  .performance-page .attendance-table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .leave-dashboard {
    padding: 1rem;
  }

  .leave-summary-grid {
    display: block;
  }

  .leave-summary-card + .leave-summary-card {
    margin-top: 0.75rem;
  }

  .leave-time-fields {
    grid-template-columns: 1fr;
  }
}

.home-tool-actions {
  margin: 1.5rem auto 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.home-tool-edit-btn,
.home-tool-add-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1rem;
  line-height: 1;
  box-sizing: border-box;
}

.home-tool-edit-btn.is-active {
  background: rgba(192, 116, 42, 0.14);
  border-color: rgba(192, 116, 42, 0.48);
  color: var(--accent);
}

.add-icon,
.home-tool-add-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
}

.home-tool-edit-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  flex: 0 0 auto;
}

.home-tool-edit-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-tool-edit-icon-check {
  display: none;
}

.home-tool-edit-btn.is-active .home-tool-edit-icon-pencil {
  display: none;
}

.home-tool-edit-btn.is-active .home-tool-edit-icon-check {
  display: block;
}

.home-tools-options {
  display: grid;
  gap: 0.75rem;
}

.home-tools-empty {
  margin: 0;
  color: rgba(42, 34, 28, 0.6);
  font-size: 0.95rem;
}

.home-tool-option {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 18px;
  padding: 0.6rem 0.35rem;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 108px;
  color: var(--ink);
  text-align: center;
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.home-tool-option:hover {
  transform: translateY(-1px);
}

#home-tools-dialog .home-tools-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#home-tools-dialog .home-tool-option {
  min-height: 108px;
  padding: 0.6rem 0.35rem;
}

#home-quick-links-dialog .home-tools-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#home-quick-links-dialog .home-tool-option {
  min-height: 108px;
  padding: 0.6rem 0.35rem;
}

.home-tool-option.is-selected {
  border-color: #c0742a;
  background: rgba(192, 116, 42, 0.14);
}

@media (max-width: 960px) {
  #home-tools-dialog .home-tools-options,
  #home-quick-links-dialog .home-tools-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #home-tools-dialog .home-tools-options,
  #home-quick-links-dialog .home-tools-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme="dark"] .home-tool-option {
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
}

html[data-theme="dark"] .home-tool-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .home-tool-option.is-selected {
  border-color: #c0742a;
  background: rgba(192, 116, 42, 0.2);
  color: var(--text-primary);
}

html[data-theme="dark"] #home-tools-dialog .account-dialog-actions,
html[data-theme="dark"] #home-quick-links-dialog .account-dialog-actions {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #account-dialog .account-dialog-actions-fixed,
html[data-theme="dark"] #account-edit-dialog .account-dialog-actions-fixed {
  background: #242a33;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.account-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dialog-close {
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.dialog-close svg,
.prompt-dialog-close svg,
.pos-dialog-close svg,
.rag-qa-minimize svg {
  pointer-events: none;
}

.dialog-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.timeline-subtitle {
  margin: -8px 0 16px;
  color: rgba(42, 34, 28, 0.6);
  font-size: 14px;
}

.history-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 0;
}

@media (max-width: 1200px) {
  .history-preview {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .history-preview {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .history-preview {
    justify-content: stretch;
  }
}

@media (max-width: 640px) {
  .home-tool-card .history-preview {
    row-gap: 1rem;
    column-gap: 1rem;
  }
}

.history-preview-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(42, 34, 28, 0.12);
  background: #f0ede6;
  aspect-ratio: 1 / 1;
  max-width: 100px;
  max-height: 100px;
  position: relative;
  flex: 0 0 calc((100% - 3rem) / 4);
}

@media (max-width: 1200px) {
  .history-preview-item {
    flex: 0 0 calc((100% - 2rem) / 3);
  }
}

@media (max-width: 900px) {
  .history-preview-item {
    flex: 0 0 calc((100% - 1rem) / 2);
  }
}

@media (max-width: 640px) {
  .history-preview-item {
    flex: 0 0 100%;
    max-width: none;
  }
}

@media (max-width: 1280px) {
  .attendance-dashboard {
    padding: 4rem 1rem 1rem 1rem;
  }

  .leave-dashboard {
    padding: 1rem;
  }

  .attendance-tabs {
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    padding: 0;
    margin: 0;
    gap: 0;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    background: rgba(248, 245, 240, 0.95);
    backdrop-filter: blur(6px);
    z-index: 5;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .attendance-tab {
    flex: 1 1 0;
    width: auto;
    text-align: center;
    font-size: 0.9rem;
    padding: 1rem 0.9rem;
    font-weight: 900;
    color: var(--ink);
    position: relative;
    white-space: nowrap;
  }

  .attendance-tab.is-active {
    color: #7a4a1e;
  }

  .attendance-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #7a4a1e;
    border-radius: 2px;
  }

  .attendance-tab-divider {
    display: none;
    flex: 0 0 auto;
    width: 1px;
    height: 16px;
    background: rgba(42, 34, 28, 0.25);
  }

  .attendance-filter {
    align-items: flex-start;
  }

  .attendance-filter-all {
    margin-right: auto;
  }

  .attendance-filter-quick {
    order: 1;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .attendance-filter-range {
    order: 2;
    width: auto;
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .attendance-filter-range:not(.is-hidden) {
    display: flex;
  }

}

@media (max-width: 640px) {
  .attendance-filter-quick {
    width: 100%;
    flex: 1 1 100%;
  }

  .attendance-filter-range {
    width: 100%;
    flex: 1 1 100%;
  }

  .attendance-filter-summary {
    flex-wrap: wrap;
  }

  .attendance-filter-all {
    width: 100%;
    margin-right: 0;
  }

  .attendance-filter-all .attendance-filter-select-wrap {
    flex: 1 1 auto;
    width: 100%;
  }
}

.history-preview-item.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    #e6e2db 20%,
    #ffffff 45%,
    #e6e2db 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.history-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-thumb {
  position: relative;
}

.history-thumb.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    #e6e2db 20%,
    #ffffff 45%,
    #e6e2db 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  z-index: 0;
}

.history-thumb.is-loading img {
  opacity: 0;
}

.history-preview-empty,
.home-tool-list-empty {
  margin: 0;
  font-size: 14px;
  color: rgba(42, 34, 28, 0.6);
  width: 100%;
  min-height: 100px;
  display: grid;
  place-items: center;
  text-align: center;
}

.home-tool-card .history-preview .history-preview-empty {
  width: 100%;
  min-height: 100px;
}

input,
textarea,
select {
  font-size: 16px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select {
  height: 40px;
}

@media (max-width: 980px) {
  .ai-dashboard .canvas-output,
  .ai-dashboard .canvas-input {
    height: auto;
  }

  .ai-dashboard .prompt-card {
    overflow: visible;
  }

  .prompt-card-top,
  .prompt-cards {
    overflow: visible;
    flex: 0 0 auto;
  }

  .prompt-card-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    background: #fff;
    padding: 0.5rem 1rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--stroke);
    border-radius: 0;
  }

  .ai-dashboard .prompt-card {
    background: transparent;
    padding: 0;
    border: none;
    padding-bottom: 280px;
  }
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(42, 34, 28, 0.15);
  font-size: 14px;
}

.timeline-item:last-child {
  border-bottom: none;
}

.status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(192, 122, 42, 0.16);
  color: var(--accent);
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.login-page .page-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.login-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-card {
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  gap: 12px;
}

.login-brand {
  font-size: 1.2rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.login-error {
  background: #f6e2db;
  color: #7b2f1f;
  border: 1px solid rgba(123, 47, 31, 0.2);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form * {
  min-width: 0;
}

.login-form label {
  font-size: 0.85rem;
  color: var(--muted);
}

.login-form input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.login-form input:focus {
  outline: 2px solid rgba(63, 107, 86, 0.3);
  border-color: rgba(63, 107, 86, 0.6);
}

.login-submit {
  width: 100%;
  padding: 12px 16px;
  margin-top: 4px;
}

.login-forgot {
  margin-top: 0.75rem;
}

@media (max-width: 1280px) {
  html.menu-open,
  body.menu-open {
    overflow: hidden;
    height: 100%;
  }

  body.menu-open .page-bg {
    overflow: hidden;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .side-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: min(360px, 72vw);
    height: 100dvh;
    border-radius: 0;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 40;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .shell.menu-open .side-menu {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .shell.menu-open .menu-overlay {
    display: block;
  }

  .shell.menu-open .layout,
  .shell.menu-open header {
    pointer-events: none;
  }

  .shell.menu-open .side-menu,
  .shell.menu-open .menu-overlay {
    pointer-events: auto;
  }

  .side-menu {
    min-height: auto;
  }
}

@media (max-width: 1024px) {
  .footer-inner {
    padding: 0;
  }
}

@media (min-width: 1024px) {
  .home-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-tool-card--large {
    grid-column: span 2;
    grid-row: span 1;
  }

  .home-tool-card--xlarge {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.devtest-dashboard {
  display: block;
}

.devtest-page .content {
  background: #fff;
}

.devtest-dashboard > * {
  margin-bottom: 1rem;
}

.devtest-dashboard > *:last-child {
  margin-bottom: 0;
}

.devtest-infobar {
  align-items: center;
  background: #e6f0ff;
  border: 1px solid #b9d2ff;
  border-radius: 16px;
  color: #2a2a2c;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 16px;
}

.devtest-infobar-content {
  align-items: center;
  display: flex;
  gap: 8px;
}

.devtest-infobar-icon {
  align-items: center;
  border: 1px solid #2a2a2c;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  line-height: 1;
  width: 20px;
}

.devtest-infobar-cta {
  white-space: nowrap;
}

.devtest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  height: auto;
  margin: 0 0 1rem;
  padding: 0;
}

.devtest-manual {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
}

.devtest-manual-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.devtest-manual-title {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.devtest-manual-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.devtest-manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.devtest-manual-card {
  border: 1px solid rgba(42, 34, 28, 0.08);
  border-radius: 14px;
  background: #faf7f2;
  padding: 0.95rem 1rem;
}

.devtest-manual-card h4 {
  margin: 0 0 0.6rem;
  font-size: 0.96rem;
  color: var(--ink);
}

.devtest-manual-pages {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.devtest-manual-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  line-height: 1.65;
}

.devtest-manual-list li + li {
  margin-top: 0.25rem;
}


.devtest-actions {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.devtest-base {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  height: auto;
}


.devtest-table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  position: relative;
  z-index: 1;
}

.rag-admin-page .devtest-table-wrap,
.rag-admin-page .attendance-table-wrap,
.rag-admin-page .account-panel,
.rag-admin-page .account-card {
  overflow: visible;
}

.devtest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.devtest-table th,
.devtest-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(42, 34, 28, 0.08);
  text-align: left;
  white-space: nowrap;
}

.devtest-table th {
  font-weight: 600;
  color: var(--muted);
  background: #faf7f2;
}

.devtest-table th .devtest-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.devtest-sort-icon {
  width: 16px;
  height: 16px;
  position: relative;
  display: inline-block;
}

.devtest-sort-icon::before,
.devtest-sort-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.devtest-sort-icon::before {
  top: 1px;
  border-bottom: 6px solid rgba(42, 34, 28, 0.35);
}

.devtest-sort-icon::after {
  bottom: 1px;
  border-top: 6px solid rgba(42, 34, 28, 0.35);
}

.devtest-sort.is-active.asc .devtest-sort-icon::before {
  border-bottom-color: #c0742a;
}

.devtest-sort.is-active.desc .devtest-sort-icon::after {
  border-top-color: #c0742a;
}

.devtest-table tr:last-child td {
  border-bottom: none;
}

.devtest-status {
  font-weight: 600;
  color: var(--muted);
}

.devtest-status.is-running {
  color: #8b5a2b;
}

.devtest-status.is-passed {
  color: #3f6b56;
}

.devtest-status.is-failed {
  color: #b91c1c;
}

.devtest-export-row.is-hidden {
  display: none;
}

.devtest-results {
  font-size: 0.9rem;
  color: var(--muted);
}

.devtest-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(42, 34, 28, 0.15);
  font-size: 0.95rem;
}

.devtest-detail-row:last-child {
  border-bottom: none;
}

.devtest-detail-row.is-hidden {
  display: none;
}

.rag-admin-dashboard {
  display: block;
}

body.rag-admin-page .dashboard {
  right: 0;
}

.rag-admin-dashboard > * {
  margin-bottom: 1rem;
}

.rag-admin-dashboard > *:last-child {
  margin-bottom: 0;
}

.rag-qa-mask {
  display: none;
}

.rag-qa-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(520px, calc(100vw - 2.5rem));
  height: min(640px, calc(100vh - var(--header-height, 68px) - 2rem));
  max-height: calc(100vh - var(--header-height, 68px) - 2rem);
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(42, 34, 28, 0.2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  z-index: 22;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}

.rag-qa-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.rag-qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(42, 34, 28, 0.12);
}

.rag-qa-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.rag-qa-title h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}

.rag-qa-history-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(320px, 100%);
}

.rag-qa-history-trigger {
  min-width: 0;
  max-width: 100%;
  height: 36px;
  border: 1px solid rgba(42, 34, 28, 0.16);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rag-qa-history-trigger:hover {
  background: rgba(42, 34, 28, 0.05);
}

.rag-qa-history-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.rag-qa-history-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
}

.rag-qa-history-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 2rem));
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid rgba(42, 34, 28, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(42, 34, 28, 0.16);
  padding: 0.4rem;
  display: grid;
  gap: 0.2rem;
}

.rag-qa-history-menu[hidden] {
  display: none !important;
}

.rag-qa-history-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--ink);
  padding: 0.6rem 0.7rem;
  text-align: left;
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
}

.rag-qa-history-item:hover {
  background: rgba(42, 34, 28, 0.05);
}

.rag-qa-history-item.is-active {
  background: rgba(193, 128, 34, 0.12);
  color: #9c6014;
}

.rag-qa-history-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-qa-history-item-preview {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-qa-history-empty {
  padding: 0.8rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.rag-qa-header-ring {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  color: #3d3d3d;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.rag-qa-header-ring::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  right: 1px;
  top: 1px;
  border-radius: 999px;
  background: currentColor;
}

.rag-qa-minimize {
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 6px;
  color: #3d3d3d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rag-qa-minimize:hover {
  background: rgba(42, 34, 28, 0.08);
}

.rag-qa-minimize svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rag-qa-toggle {
  -webkit-tap-highlight-color: transparent;
  /* Reset .history-toggle base styles */
  position: static;
  top: auto;
  right: auto;
  transform: none;
  writing-mode: horizontal-tb;
  text-orientation: auto;
  letter-spacing: normal;
  border-radius: 10px;
  padding: 0;
  z-index: auto;
  background: transparent;
  transition: background 0.15s ease;
}

.rag-qa-toggle-header {
  display: inline-flex;
}

.rag-qa-toggle-header.is-open {
  background: rgba(42, 34, 28, 0.08);
}

.rag-qa-toggle .rag-qa-fab-ring {
  width: 18px;
  height: 18px;
  border: 3px solid #edbc60;
  border-radius: 999px;
  display: block;
  flex: 0 0 auto;
  box-shadow: 0 0 6px rgba(237, 188, 96, 0.8), 0 0 14px rgba(237, 188, 96, 0.4), inset 0 0 5px rgba(237, 188, 96, 0.5);
}

.rag-qa-toggle-orb {
  display: none !important;
}

.rag-qa-toggle-orb .assistant-orb {
  pointer-events: none;
}

.rag-qa-toggle-orb.is-open {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

@media (min-width: 641px) {
  .attendance-page .rag-qa-toggle-orb {
    bottom: 5rem;
  }
}

@media (min-width: 641px) and (max-width: 1280px) {
  .inventory-page .rag-qa-toggle-orb {
    bottom: 5rem;
  }
}

.rag-qa-messages {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.95rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
  height: 100%;
}

.rag-qa-empty {
  margin: 0;
  width: 100%;
  min-height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 0 0.75rem;
}

.rag-qa-empty .assistant-orb {
  align-self: center;
  margin-bottom: 1.25rem;
}

.rag-qa-empty-title {
  margin: 0 0 0.75rem 0;
  color: #3D3D3D;
  font-weight: 400;
}

.rag-qa-empty-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #6d6258;
}

.rag-qa-message {
  margin: 0;
  max-width: 92%;
  border-radius: 12px;
  padding: 0.55rem 0.68rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.rag-qa-message.user {
  align-self: flex-end;
  background: #f1ece2;
  color: var(--ink);
}

.rag-qa-message.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(42, 34, 28, 0.14);
  color: var(--ink);
}

.rag-qa-input-wrap {
  position: relative;
  width: 100%;
  border-top: 1px solid rgba(42, 34, 28, 0.12);
  padding: 0.85rem 0.95rem 0.95rem;
  background: #fff;
}

#rag-qa-input {
  width: 100%;
  border: 1px solid rgba(42, 34, 28, 0.16);
  border-radius: 14px;
  min-height: 104px;
  padding: 0.75rem 3rem 0.75rem 0.85rem;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  background: #fff;
}

.rag-qa-send {
  position: absolute;
  right: 1.65rem;
  bottom: 1.65rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #ede7dc;
  color: #6d6258;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
}

.rag-qa-send.is-ready,
.rag-qa-send.is-sending {
  background: #3d3d3d;
  color: #fff;
}

.rag-qa-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
}

.rag-qa-selection-pill {
  position: absolute;
  left: 1.45rem;
  bottom: 1.65rem;
  font-size: 0.75rem;
  line-height: 1;
  background: rgba(95, 143, 120, 0.1);
  color: #4a7a63;
  border: 1px solid rgba(95, 143, 120, 0.3);
  border-radius: 999px;
  padding: 0.22rem 0.6rem 0.22rem 0.45rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: default;
}
.rag-qa-selection-pill[hidden] {
  display: none !important;
}

.btn[hidden],
.cta[hidden] {
  display: none !important;
}

.rag-qa-selection-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.rag-qa-selection-clear svg {
  pointer-events: none;
  display: block;
}

html[data-theme="dark"] .rag-qa-selection-pill {
  background: rgba(95, 143, 120, 0.15);
  color: #7fbfa3;
  border-color: rgba(95, 143, 120, 0.35);
}

@media (max-width: 980px) {
  .rag-qa-panel {
    right: 12px;
    bottom: 12px;
    width: min(520px, calc(100vw - 1.5rem));
    height: min(70vh, 580px);
    max-height: calc(100vh - var(--header-height, 68px) - 1rem);
  }
}

@media (max-width: 640px) {
  .rag-qa-title h4 {
    display: none;
  }

  .rag-qa-history-dropdown {
    max-width: min(220px, 100%);
  }

  .rag-qa-history-menu {
    min-width: min(260px, calc(100vw - 2rem));
  }

  .rag-qa-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 31;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body:has(.rag-qa-panel.open) .rag-qa-mask {
    opacity: 1;
    pointer-events: auto;
  }

  .rag-qa-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--header-height, 68px);
    width: 100vw;
    height: auto;
    max-height: none;
    border-radius: 16px 16px 0 0;
    opacity: 1;
    z-index: 32;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .rag-qa-panel.open {
    transform: translateY(0);
  }
}

html[data-theme="dark"] .rag-qa-panel {
  background: #1d222a;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .rag-qa-header,
html[data-theme="dark"] .rag-qa-input-wrap {
  border-color: rgba(255, 255, 255, 0.12);
  background: #1d222a;
}

html[data-theme="dark"] .rag-qa-title h4 {
  color: var(--text-primary);
}

html[data-theme="dark"] .rag-qa-history-trigger {
  background: #20262f;
  color: #e6ebf2;
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .rag-qa-history-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .rag-qa-history-menu {
  background: #20262f;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .rag-qa-history-item {
  color: #e6ebf2;
}

html[data-theme="dark"] .rag-qa-history-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .rag-qa-history-item.is-active {
  background: rgba(193, 128, 34, 0.18);
  color: #f0c27b;
}

html[data-theme="dark"] .rag-qa-history-item-preview,
html[data-theme="dark"] .rag-qa-history-empty {
  color: var(--text-secondary);
}

html[data-theme="dark"] .rag-qa-header-ring {
  color: #dbe2ec;
}

html[data-theme="dark"] .rag-qa-minimize {
  color: #dbe2ec;
}

html[data-theme="dark"] .rag-qa-minimize:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .rag-qa-empty-title {
  color: var(--text-primary);
}

html[data-theme="dark"] .rag-qa-empty-text {
  color: var(--text-secondary);
}

html[data-theme="dark"] .rag-qa-message.user {
  background: #2b3240;
  color: #e6ebf2;
}

html[data-theme="dark"] .rag-qa-message.bot {
  background: #222833;
  border-color: rgba(255, 255, 255, 0.14);
  color: #e6ebf2;
}

html[data-theme="dark"] #rag-qa-input {
  background: #20262f;
  color: #e6ebf2;
  border-color: rgba(255, 255, 255, 0.16);
}

/* .rag-qa-toggle is transparent; the orb handles its own visuals */

.holdings-grid {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.holdings-grid:not(:empty),
.holdings-grid.has-items,
.holdings-grid.has-holdings,
.holdings-grid[data-has-holdings="true"] {
  margin-bottom: 8rem !important;
  padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px)) !important;
}

.holdings-panel .holdings-grid:not(:empty),
.holdings-panel .holdings-grid.has-items,
.holdings-panel .holdings-grid.has-holdings,
.holdings-panel .holdings-grid[data-has-holdings="true"] {
  padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
}

.holdings-panel .holdings-grid .holdings-table-card {
  padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
}

.holdings-panel .holdings-grid .holdings-table-card .table-wrap,
.holdings-panel .holdings-grid .holdings-table-card .holdings-table-wrap,
.holdings-panel .holdings-grid .holdings-table-card .table-responsive {
  padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
}

.rag-admin-header {
  display: block;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.rag-admin-search {
  min-width: 0;
  width: 100%;
  max-width: 320px;
  grid-area: search;
}

.rag-drive-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "tabs tabs tabs"
    "meta meta meta"
    "search type upload";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.75rem;
  width: 100%;
  overflow: visible;
  position: relative;
  z-index: 20;
}

.rag-drive-controls > * {
  flex-shrink: 0;
}

.rag-type-filter {
  grid-area: type;
  width: 140px;
  position: relative;
  z-index: 50;
}

.rag-type-filter .dropdown-trigger {
  border: 1px solid rgba(42, 34, 28, 0.18);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  min-height: 40px;
  height: 40px;
  justify-content: space-between;
  width: 100%;
}

.rag-type-filter .dropdown-menu {
  width: 100%;
  z-index: 40;
}

.rag-drive-tabs {
  grid-area: tabs;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.rag-drive-tabs .ai-tab {
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex: none;
  font-family: "Noto Sans TC", "Metropolis", sans-serif !important;
  font-size: 1.5rem;
  color: #3D3D3D;
  font-weight: 900;
}

.rag-drive-tabs .ai-tab.is-active {
  color: #c0742a;
}

.rag-drive-tabs .ai-tab.is-active::after {
  content: none;
}

.rag-drive-tab-divider {
  width: 1px;
  height: 18px;
  background: rgba(42, 34, 28, 0.2);
}

.rag-folder-meta {
  display: inline-flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  grid-area: meta;
}

.rag-drive-controls[data-scope="shared"] .rag-folder-meta {
  display: none !important;
}

.rag-folder-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 280px;
  min-width: 0;
}

.rag-folder-title svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rag-folder-title-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-breadcrumb-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Metropolis", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-breadcrumb-link:hover {
  color: #3D3D3D;
}

.rag-folder-meta .text-btn,
.rag-folder-meta .text-btn:focus-visible,
.rag-folder-meta .text-btn:active {
  color: var(--muted);
}

.rag-folder-meta .text-btn:hover {
  color: #3D3D3D;
}

.rag-folder-title svg,
.rag-folder-title:hover svg {
  color: var(--muted);
}

.rag-breadcrumb-sep {
  color: var(--muted);
}

.rag-drive-more-wrap {
  position: relative;
}

.rag-drive-more-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.rag-drive-more-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rag-drive-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 8;
}

.rag-drive-more-menu[hidden] {
  display: none !important;
}

.rag-drive-more-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
}

.rag-drive-more-item-danger {
  color: #dc2626;
  -webkit-text-fill-color: #dc2626;
}

.rag-drive-more-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.rag-drive-more-item-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.btn.secondary.rag-open-upload-inline {
  grid-area: upload;
  width: auto !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #c0742a;
  color: #fff;
  border: 1px solid #c0742a;
}

.btn.secondary.rag-open-upload-inline:hover {
  background: #a8601f;
  border-color: #a8601f;
  color: #fff;
}

.rag-open-upload-inline svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rag-check-col {
  width: 44px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.rag-check-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.rag-admin-table thead .rag-check-col {
  background: #faf7f2;
  z-index: 4;
}

.rag-google-empty {
  border: 1px dashed var(--stroke);
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
}

.rag-google-empty h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
}

.rag-google-empty p {
  margin: 0;
  color: var(--muted);
}

.rag-drive-controls[hidden],
#rag-open-upload[hidden],
.rag-google-empty[hidden],
.rag-admin-dashboard .devtest-table-wrap[hidden] {
  display: none !important;
}

.google-g-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  background: conic-gradient(
    #4285f4 0deg 90deg,
    #34a853 90deg 180deg,
    #fbbc05 180deg 270deg,
    #ea4335 270deg 360deg
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile-google-bind {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-google-bind [hidden] {
  display: none !important;
}

.rag-admin-upload {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
}

.rag-admin-upload .account-form {
  display: grid;
  gap: 1rem;
}

.rag-upload-drop {
  border-radius: 18px;
  border: 1px dashed rgba(42, 34, 28, 0.28);
  min-height: 160px;
  display: grid;
  place-items: center;
  gap: 1rem;
  color: rgba(42, 34, 28, 0.55);
  cursor: pointer;
  text-align: center;
  padding: 1rem;
  position: relative;
}

.rag-upload-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.rag-upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(42, 34, 28, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: rgba(42, 34, 28, 0.7);
}

.rag-upload-text {
  font-size: 0.95rem;
}

.rag-upload-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rag-admin-table .rag-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
}

.rag-admin-table .rag-actions .btn {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.rag-action-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rag-admin-table .rag-delete-drive,
.rag-admin-table .rag-remove {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.5);
}

.rag-admin-table .rag-delete-drive:hover,
.rag-admin-table .rag-remove:hover {
  background: rgba(220, 38, 38, 0.08);
}

.rag-name-main {
  font-weight: 400;
  line-height: 1.3;
}

.rag-name-link {
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.rag-name-link:hover {
  color: #87644E;
  text-decoration: underline;
}

.rag-name-meta {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.rag-type-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.rag-type-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.rag-type-icon::before {
  content: "檔";
}

.rag-type-folder {
  background: #87644E;
}
.rag-type-folder::before {
  content: "夾";
}

.rag-type-pdf {
  background: #dc2626;
}
.rag-type-pdf::before {
  content: "PDF";
  font-size: 8px;
}

.rag-type-ppt {
  background: #f59e0b;
}
.rag-type-ppt::before {
  content: "PPT";
  font-size: 8px;
}

.rag-type-doc {
  background: #2563eb;
}
.rag-type-doc::before {
  content: "DOC";
  font-size: 8px;
}

.rag-type-sheet {
  background: #16a34a;
}
.rag-type-sheet::before {
  content: "XLS";
  font-size: 8px;
}

.rag-type-image {
  background: #e11d48;
}
.rag-type-image::before {
  content: "圖";
}

.rag-type-video {
  background: #7c3aed;
}
.rag-type-video::before {
  content: "影";
}

.rag-type-file {
  background: #6b7280;
}

.rag-admin-table {
  min-width: 860px;
}

.rag-share-item {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.account-form label.rag-share-item {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
}

.rag-share-item input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.rag-share-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-share-dropdown .dropdown-menu {
  left: 0;
  right: auto;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
}

.rag-share-dropdown .dropdown-trigger {
  border: 1px solid rgba(42, 34, 28, 0.18);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  min-width: 240px;
  height: 40px;
  justify-content: space-between;
  width: 100%;
}

.rag-share-drive-role-dropdown {
  width: 100%;
}

.rag-share-drive-email-dropdown {
  width: 100%;
}

.rag-share-drive-email-dropdown .dropdown-trigger,
.rag-share-drive-role-dropdown .dropdown-trigger {
  border: 1px solid rgba(42, 34, 28, 0.18);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  min-height: 40px;
  height: 40px;
  justify-content: space-between;
  width: 100%;
}

.rag-share-drive-email-dropdown .dropdown-menu,
.rag-share-drive-role-dropdown .dropdown-menu {
  width: 100%;
}

.rag-share-drive-email-dropdown .dropdown-menu {
  max-height: 260px;
  overflow: hidden;
}

.rag-share-drive-email-dropdown .dropdown-search {
  width: calc(100% - 1rem);
  height: 40px;
  margin: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(42, 34, 28, 0.18);
  padding: 0 12px;
  font: inherit;
}

.rag-share-drive-email-dropdown .dropdown-list {
  max-height: 180px;
  overflow-y: auto;
}

.rag-admin-table .btn {
  white-space: nowrap;
}

.rag-preview-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  display: grid;
  gap: 0.75rem;
}

.rag-preview-dialog .account-dialog-actions,
.rag-upload-dialog .account-dialog-actions,
.rag-share-drive-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

#rag-upload {
  background: #496f4b;
  border-color: #496f4b;
  color: #fff;
}

#rag-upload:hover {
  background: #3f6b56;
  border-color: #3f6b56;
  color: #fff;
}

.rag-delete-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  margin-bottom: 1rem;
}

.rag-delete-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.attendance-delete-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  margin-bottom: 1rem;
}

.attendance-delete-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

#schedule-delete-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  margin-bottom: 1rem;
}

#schedule-delete-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.performance-delete-dialog[open] {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  display: grid;
  place-items: center;
}

.performance-delete-dialog .account-dialog-inner {
  width: min(420px, calc(100vw - 32px));
}

.performance-delete-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  margin-bottom: 1rem;
}

.performance-delete-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.rag-folder-dialog .account-dialog-body {
  padding: 0.5rem 1rem 0;
  display: grid;
  gap: 0.75rem;
}

.rag-folder-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.rag-folder-search {
  width: 100%;
}

.rag-folder-list {
  display: grid;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.rag-folder-list-item {
  width: 100%;
  border: 1px solid rgba(42, 34, 28, 0.16);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.rag-folder-list-item.is-selected {
  border-color: #87644E;
  background: rgba(135, 100, 78, 0.08);
}

.rag-folder-list-empty {
  color: var(--muted);
  padding: 0.5rem 0.25rem;
}

.rag-preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rag-preview-note {
  color: #a06a2a;
}

.rag-preview-content {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 0.75rem;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

#devtest-detail-dialog .account-dialog-body {
  padding: 0.5rem 0 0;
  display: grid;
  gap: 0.75rem;
}

#devtest-detail-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .devtest-infobar {
    align-items: flex-start;
    flex-direction: column;
  }

  .rag-admin-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .rag-drive-controls {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tabs tabs"
      "meta meta"
      "search type"
      "upload upload";
  }

  .rag-drive-tabs {
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    z-index: 90;
  }

  .rag-folder-meta {
    justify-content: space-between;
  }

  .rag-admin-search {
    min-width: 0;
    max-width: none;
  }

  .rag-open-upload-inline {
    justify-self: stretch;
    width: 100% !important;
    justify-content: center;
  }

  .rag-folder-title {
    max-width: 180px;
  }

  .devtest-header {
    flex-direction: column;
    align-items: stretch;
  }

  .devtest-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 769px) {
  .rag-folder-title {
    font-size: 24px;
    line-height: 1.2;
  }

  .rag-folder-title svg {
    width: 24px;
    height: 24px;
  }
}

/* Keep rag tabs in attendance-style for medium/small viewports. */
@media (max-width: 1280px) {
  .rag-drive-tabs {
    display: flex;
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    gap: 0;
    align-items: center;
    background: #f8f5f0;
    z-index: 90;
    border-bottom: 1px solid rgba(42, 34, 28, 0.12);
  }

  .rag-drive-tabs .ai-tab {
    flex: 1;
    margin: 0;
    padding: 1rem 0;
    text-align: center;
    font-family: "Noto Sans TC", "Metropolis", sans-serif !important;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    background: transparent;
    border-radius: 0;
    position: relative;
  }

  .rag-drive-tabs .ai-tab.is-active {
    color: var(--accent);
  }

  .rag-drive-tabs .ai-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
  }

  .rag-drive-tab-divider {
    display: none;
    width: 1px;
    height: 20px;
    flex: 0 0 1px;
    background: rgba(42, 34, 28, 0.2);
  }
}

/* Dark theme patch: strengthen component-level coverage to avoid light remnants. */
html[data-theme="dark"] .menu-sub {
  background: #171a1f;
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .menu-sub-item,
html[data-theme="dark"] .menu-sub-item a,
html[data-theme="dark"] .menu-status,
html[data-theme="dark"] .menu-user-name,
html[data-theme="dark"] .menu-user-role,
html[data-theme="dark"] .menu-user-time,
html[data-theme="dark"] .menu-version {
  color: #d9dde4;
}

html[data-theme="dark"] .menu-sub-item,
html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .side-menu-profile {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .menu-item:hover,
html[data-theme="dark"] .menu-sub-item a:hover,
html[data-theme="dark"] .menu-item.active:not(summary),
html[data-theme="dark"] .menu-sub-item.active a {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .side-menu-avatar {
  background: #262b33;
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .side-menu-avatar svg {
  stroke: #c2c9d4;
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .home-quick-link-card,
html[data-theme="dark"] .home-tool-card,
html[data-theme="dark"] .home-tool-empty,
html[data-theme="dark"] .history-preview,
html[data-theme="dark"] .history-preview-item,
html[data-theme="dark"] .attendance-panel,
html[data-theme="dark"] .inventory-panel,
html[data-theme="dark"] .inventory-kpi,
html[data-theme="dark"] .inventory-table-wrap,
html[data-theme="dark"] .rag-table-wrap,
html[data-theme="dark"] .attendance-table-wrap,
html[data-theme="dark"] .devtest-table-wrap,
html[data-theme="dark"] .account-table-wrap {
  background: #1d222a;
  color: #e6ebf2;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .attendance-card,
html[data-theme="dark"] .leave-card {
  background: #1d222a;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .attendance-mobile-card-head p,
html[data-theme="dark"] .attendance-mobile-card-note,
html[data-theme="dark"] .attendance-mobile-card-meta strong {
  color: var(--text-secondary);
}

html[data-theme="dark"] .attendance-mobile-card-meta span,
html[data-theme="dark"] .attendance-mobile-card-head h3 {
  color: var(--text-primary);
}

html[data-theme="dark"] .attendance-page .attendance-mobile-list,
html[data-theme="dark"] .leave-page .attendance-mobile-list,
html[data-theme="dark"] .performance-page .attendance-mobile-list,
html[data-theme="dark"] .promotion-page .attendance-mobile-list,
html[data-theme="dark"] .employee-accounts-page .attendance-mobile-list,
html[data-theme="dark"] .rag-admin-page .attendance-mobile-list {
  background: #1d222a;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .employee-accounts-page .attendance-mobile-list,
html[data-theme="dark"] .employee-accounts-page .attendance-mobile-card {
  overflow: visible;
}

html[data-theme="dark"] .attendance-page .attendance-mobile-card + .attendance-mobile-card,
html[data-theme="dark"] .leave-page .attendance-mobile-card + .attendance-mobile-card,
html[data-theme="dark"] .performance-page .attendance-mobile-card + .attendance-mobile-card,
html[data-theme="dark"] .promotion-page .attendance-mobile-card + .attendance-mobile-card,
html[data-theme="dark"] .employee-accounts-page .attendance-mobile-card + .attendance-mobile-card,
html[data-theme="dark"] .rag-admin-page .attendance-mobile-card + .attendance-mobile-card {
  border-top-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .home-tool-header,
html[data-theme="dark"] .card-head,
html[data-theme="dark"] .inventory-panel-header {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .home-quick-link-icon {
  background: linear-gradient(135deg, rgba(207, 160, 98, 0.18), rgba(93, 123, 198, 0.26));
  color: #f2d4a7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .account-table,
html[data-theme="dark"] .assistant-table,
html[data-theme="dark"] .rag-table,
html[data-theme="dark"] .inventory-table,
html[data-theme="dark"] .attendance-table,
html[data-theme="dark"] .devtest-table {
  color: #e6ebf2;
}

html[data-theme="dark"] .account-table th,
html[data-theme="dark"] .assistant-table th,
html[data-theme="dark"] .rag-table th,
html[data-theme="dark"] .inventory-table th,
html[data-theme="dark"] .attendance-table th,
html[data-theme="dark"] .devtest-table th {
  background: #242a33;
  color: #dbe2ec;
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .account-table td,
html[data-theme="dark"] .assistant-table td,
html[data-theme="dark"] .rag-table td,
html[data-theme="dark"] .inventory-table td,
html[data-theme="dark"] .attendance-table td,
html[data-theme="dark"] .devtest-table td {
  color: #e6ebf2;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .schedule-hero-card,
html[data-theme="dark"] .schedule-calendar-card,
html[data-theme="dark"] .schedule-day-card,
html[data-theme="dark"] .schedule-fixed-card,
html[data-theme="dark"] .schedule-form-card,
html[data-theme="dark"] .schedule-calendar-day,
html[data-theme="dark"] .schedule-item-card {
  background: #111417;
  border-color: #2a3138;
}

html[data-theme="dark"] .schedule-member-badge-1 {
  background: #183654;
  border-color: #27517a;
  color: #d8e9ff;
}

html[data-theme="dark"] .schedule-member-badge-2 {
  background: #173b2a;
  border-color: #2a6a4a;
  color: #d8f7e4;
}

html[data-theme="dark"] .schedule-member-badge-3 {
  background: #4a3016;
  border-color: #7c5025;
  color: #ffe4c2;
}

html[data-theme="dark"] .schedule-member-badge-4 {
  background: #432650;
  border-color: #71418a;
  color: #f0dcff;
}

html[data-theme="dark"] .schedule-member-badge-5 {
  background: #4c2230;
  border-color: #874359;
  color: #ffd9e1;
}

html[data-theme="dark"] .schedule-member-badge-6 {
  background: #153f42;
  border-color: #2b7075;
  color: #d9f9fb;
}

html[data-theme="dark"] .schedule-member-badge-7 {
  background: #4b3b14;
  border-color: #816821;
  color: #ffefb8;
}

html[data-theme="dark"] .schedule-member-badge-8 {
  background: #2c3440;
  border-color: #475364;
  color: #ebf0f6;
}

html[data-theme="dark"] .schedule-calendar-day-skeleton,
html[data-theme="dark"] .schedule-item-card-skeleton,
html[data-theme="dark"] .schedule-skeleton-line,
html[data-theme="dark"] .schedule-skeleton-pill,
html[data-theme="dark"] .schedule-skeleton-tag,
html[data-theme="dark"] .schedule-skeleton-btn,
html[data-theme="dark"] .schedule-skeleton-dot {
  background: linear-gradient(
    100deg,
    rgba(58, 67, 80, 0.72) 20%,
    rgba(86, 97, 112, 0.95) 45%,
    rgba(58, 67, 80, 0.72) 70%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .schedule-subtitle,
html[data-theme="dark"] .schedule-eyebrow,
html[data-theme="dark"] .schedule-panel-head p,
html[data-theme="dark"] .schedule-calendar-heading p,
html[data-theme="dark"] .schedule-item-meta,
html[data-theme="dark"] .schedule-item-note,
html[data-theme="dark"] .schedule-calendar-more,
html[data-theme="dark"] .schedule-hero-stat span,
html[data-theme="dark"] .schedule-calendar-weekdays span {
  color: #9aa5b1;
}

html[data-theme="dark"] .schedule-calendar-weekdays span:first-child,
html[data-theme="dark"] .schedule-calendar-weekdays span:last-child {
  color: #ff8b8b;
}

html[data-theme="dark"] .schedule-hero-stat {
  background: rgba(18, 23, 29, 0.92);
  border-color: #2a3138;
}

html[data-theme="dark"] .schedule-source-tag-leave {
  background: rgba(125, 32, 45, 0.28);
  color: #ffb4bc;
}

html[data-theme="dark"] .schedule-mode-tag-leave-type {
  background: rgba(125, 32, 45, 0.22);
  color: #ffd4da;
}

html[data-theme="dark"] .schedule-status-tag-submitted {
  background: rgba(67, 76, 88, 0.72);
  color: #e2e8f0;
}

html[data-theme="dark"] .schedule-status-tag-approved {
  background: rgba(29, 107, 61, 0.28);
  color: #b8efcb;
}

html[data-theme="dark"] .schedule-status-tag-rejected,
html[data-theme="dark"] .schedule-status-tag-cancelled {
  background: rgba(125, 32, 45, 0.28);
  color: #ffb4bc;
}

html[data-theme="dark"] .schedule-item-leave-note {
  color: #ff9aa5;
}

html[data-theme="dark"] .schedule-item-card-leave {
  background: rgba(47, 23, 27, 0.48);
  border-color: rgba(208, 122, 122, 0.22);
}

html[data-theme="dark"] .schedule-item-card-has-leave {
  border-color: rgba(208, 122, 122, 0.28);
}

html[data-theme="dark"] .schedule-item-card-rule {
  background: rgba(63, 45, 22, 0.34);
}

html[data-theme="dark"] .schedule-item-card-event {
  background: rgba(47, 23, 27, 0.48);
  border-color: rgba(208, 122, 122, 0.22);
}

html[data-theme="dark"] .schedule-item-card-event:hover {
  border-color: rgba(208, 122, 122, 0.38);
}

html[data-theme="dark"] .schedule-calendar-chip-event,
html[data-theme="dark"] .schedule-source-tag-event {
  background: rgba(180, 35, 24, 0.3);
  color: #ff9aa5;
}

html[data-theme="dark"] .schedule-item-card-leave:hover,
html[data-theme="dark"] .schedule-item-card-has-leave:hover {
  border-color: rgba(208, 122, 122, 0.38);
}

html[data-theme="dark"] .schedule-item-callout-leave {
  background: rgba(125, 32, 45, 0.16);
  border-color: rgba(208, 122, 122, 0.2);
}

html[data-theme="dark"] .schedule-item-callout-range {
  background: rgba(118, 84, 23, 0.2);
  border-color: rgba(207, 160, 98, 0.18);
}

html[data-theme="dark"] .schedule-calendar-day.is-selected {
  border-color: rgba(239, 196, 132, 0.72);
  background: rgba(145, 84, 17, 0.22);
  box-shadow: 0 0 0 3px rgba(239, 196, 132, 0.22);
}

html[data-theme="dark"] .schedule-calendar-day.is-selected .schedule-calendar-day-number {
  color: #f2d4a7;
  -webkit-text-fill-color: #f2d4a7;
}

html[data-theme="dark"] .schedule-calendar-day.has-event .schedule-calendar-day-number {
  color: #ff9aa5;
  -webkit-text-fill-color: #ff9aa5;
}

html[data-theme="dark"] .schedule-member-alert {
  background: rgba(84, 54, 20, 0.26);
  border-color: rgba(239, 196, 132, 0.18);
  color: #f2d4a7;
}

html[data-theme="dark"] .schedule-create-inner {
  background: #1f242b;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .schedule-create-header {
  background: #1f242b;
}

html[data-theme="dark"] .schedule-create-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .schedule-add-open-wrap {
  background: var(--panel-elevated);
  border-top-color: var(--stroke);
}

html[data-theme="dark"] .schedule-create-tab {
  color: #e6ebf2;
}

html[data-theme="dark"] .schedule-create-tab.is-active {
  color: #cfa062;
}

html[data-theme="dark"] .schedule-create-tab.is-active::after {
  background: #cfa062;
}

html[data-theme="dark"] .schedule-create-inner > .account-dialog-actions,
html[data-theme="dark"] #schedule-event-dialog .account-dialog-actions {
  background: #1f242c;
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #schedule-detail-dialog .schedule-detail-actions {
  background: #1f242c;
}

html[data-theme="dark"] .schedule-weekday-label {
  color: #e6ebf2;
}

html[data-theme="dark"] .schedule-weekday-chip span {
  background: #111417;
  border-color: #2a3138;
  color: #dbe2ec;
}

html[data-theme="dark"] .schedule-weekday-chip input:checked + span {
  background: rgba(192, 116, 42, 0.18);
  border-color: rgba(192, 116, 42, 0.56);
  color: #f2d4a7;
  box-shadow: 0 0 0 3px rgba(192, 116, 42, 0.12);
}

html[data-theme="dark"] .schedule-item-actions .schedule-delete-btn,
html[data-theme="dark"] #schedule-detail-dialog .schedule-detail-delete {
  border-color: rgba(208, 122, 122, 0.5) !important;
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
}

html[data-theme="dark"] .schedule-item-actions .schedule-delete-btn:hover,
html[data-theme="dark"] #schedule-detail-dialog .schedule-detail-delete:hover {
  background: rgba(208, 122, 122, 0.18) !important;
  border-color: rgba(208, 122, 122, 0.5) !important;
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
}

html[data-theme="dark"] .devtest-infobar {
  background: #1f2a3c;
  border-color: rgba(146, 177, 228, 0.55);
  color: #dce7fb;
}

html[data-theme="dark"] .devtest-manual {
  background: #1d222a;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .devtest-manual-card {
  background: #242a33;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .devtest-infobar-icon {
  border-color: #dce7fb;
  color: #dce7fb;
}

html[data-theme="dark"] .table-empty,
html[data-theme="dark"] .rag-admin-empty,
html[data-theme="dark"] .inventory-empty {
  color: #aeb6c3;
}

html[data-theme="dark"] .account-search,
html[data-theme="dark"] .account-sort,
html[data-theme="dark"] .dropdown-trigger,
html[data-theme="dark"] .rag-share-dropdown .dropdown-trigger,
html[data-theme="dark"] .rag-share-drive-email-dropdown .dropdown-trigger,
html[data-theme="dark"] .rag-share-drive-role-dropdown .dropdown-trigger,
html[data-theme="dark"] .rag-share-drive-email-dropdown .dropdown-search,
html[data-theme="dark"] .rag-folder-list-item,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #1f242c;
  color: #e6ebf2;
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .account-search-wrap,
html[data-theme="dark"] .account-sort-wrap {
  background: #1f242c;
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .account-action-trigger,
html[data-theme="dark"] .account-action-dropdown-menu {
  background: #242a33;
  border-color: rgba(255, 255, 255, 0.14);
  color: #e6ebf2;
}

html[data-theme="dark"] .account-menu-item {
  color: #dde4ee;
}

html[data-theme="dark"] .account-menu-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .account-action-dropdown-menu .account-delete,
html[data-theme="dark"] .account-action-dropdown-menu .account-toggle.danger,
html[data-theme="dark"] .account-table .account-action-dropdown-menu .account-delete {
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .account-action-dropdown-menu .account-delete:hover:not(:disabled) {
  background: rgba(208, 122, 122, 0.12) !important;
}

html[data-theme="dark"] .account-search,
html[data-theme="dark"] .account-search-wrap {
  background: transparent !important;
}

html[data-theme="dark"] .account-search-wrap:focus-within,
html[data-theme="dark"] .account-sort-wrap:focus-within {
  border-color: #c0742a;
  box-shadow: 0 0 0 3px rgba(192, 116, 42, 0.28);
}

html[data-theme="dark"] .account-search-icon,
html[data-theme="dark"] .account-sort-icon {
  stroke: #c9d1dc;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .rag-drive-more-menu,
html[data-theme="dark"] .home-tool-menu,
html[data-theme="dark"] .prompt-dialog-menu,
html[data-theme="dark"] .rag-folder-dialog-list {
  background: #1c2129;
  border-color: rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .rag-drive-more-item,
html[data-theme="dark"] .home-tool-menu-item,
html[data-theme="dark"] .prompt-dialog-menu-item {
  color: #dde4ee;
}

html[data-theme="dark"] .dropdown-item.is-active,
html[data-theme="dark"] .rag-drive-more-item.is-active,
html[data-theme="dark"] .prompt-dialog-menu-item.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
  background: rgba(192, 116, 42, 0.14);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .rag-drive-more-item:hover,
html[data-theme="dark"] .home-tool-menu-item:hover,
html[data-theme="dark"] .prompt-dialog-menu-item:hover,
html[data-theme="dark"] .rag-folder-list-item:hover,
html[data-theme="dark"] .rag-folder-list-item.is-selected {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .rag-drive-more-item-danger {
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
}

html[data-theme="dark"] .rag-drive-more-item-danger:hover {
  background: rgba(208, 122, 122, 0.16);
}

html[data-theme="dark"] .home-tool-menu-item[data-tool-remove] {
  color: var(--danger-accent) !important;
  -webkit-text-fill-color: var(--danger-accent) !important;
}

html[data-theme="dark"] .home-tool-menu-item[data-tool-remove]:hover {
  background: rgba(208, 122, 122, 0.16);
}

html[data-theme="dark"] .rag-drive-tabs {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1280px) {
  html[data-theme="dark"] .rag-drive-tabs {
    background: #171a1f;
    border-bottom-color: rgba(255, 255, 255, 0.14);
  }
}

html[data-theme="dark"] .rag-drive-tabs .ai-tab {
  background: transparent !important;
  color: #c9d1dc !important;
  -webkit-text-fill-color: #c9d1dc !important;
}

html[data-theme="dark"] .rag-drive-tabs .ai-tab.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .rag-drive-tabs .ai-tab.is-active::after {
  background: #c0742a;
}

html[data-theme="dark"] .rag-drive-tabs .ai-tab[aria-selected="true"] {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .rag-drive-tab-divider {
  background: rgba(255, 255, 255, 0.26);
}

html[data-theme="dark"] .header-icon-btn {
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .hero.hero-assistant {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .home-quick-links {
  background: rgba(29, 34, 42, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .home-quick-links-edit {
  background: rgba(17, 21, 27, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6ebf2;
}

html[data-theme="dark"] .home-quick-links-edit:hover,
html[data-theme="dark"] .home-tool-more:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: none;
}

html[data-theme="dark"] .home-quick-links-skeleton {
  background: linear-gradient(
    90deg,
    rgba(49, 56, 68, 0.9) 0%,
    rgba(61, 69, 82, 0.98) 50%,
    rgba(49, 56, 68, 0.9) 100%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .notification-panel {
  background: rgba(29, 34, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .notification-panel-header {
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .notification-panel-header h4,
html[data-theme="dark"] .notification-section h5,
html[data-theme="dark"] .notification-item-title,
html[data-theme="dark"] .notification-panel-close {
  color: #eef2f7;
}

html[data-theme="dark"] .notification-item-summary,
html[data-theme="dark"] .notification-item-time,
html[data-theme="dark"] .notification-empty {
  color: #b8c1cf;
}

html[data-theme="dark"] .notification-skeleton-line,
html[data-theme="dark"] .notification-skeleton-dot,
html[data-theme="dark"] .performance-skeleton-menu {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  background-size: 200% 100%;
}

html[data-theme="dark"] .notification-panel-close {
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .notification-panel-close:hover,
html[data-theme="dark"] .notification-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .notification-item-label {
  color: #e0a667;
}

html[data-theme="dark"] .notification-tab {
  color: #b8c1cf;
}

html[data-theme="dark"] .notification-tab.is-active {
  background: rgba(224, 166, 103, 0.18);
  color: #e0a667;
}

html[data-theme="dark"] .notification-section-link {
  color: #81aef5;
}

.hero.hero-assistant {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* Dark-mode hardening: patch remaining light surfaces and low-contrast text. */
html[data-theme="dark"] .ai-tab,
html[data-theme="dark"] .prompt-tab,
html[data-theme="dark"] .dropdown-trigger,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .home-tool-menu-item {
  color: #e6ebf2 !important;
  -webkit-text-fill-color: #e6ebf2 !important;
}

html[data-theme="dark"] .attendance-tab,
html[data-theme="dark"] .inventory-tab {
  color: #e6ebf2 !important;
  -webkit-text-fill-color: #e6ebf2 !important;
}

html[data-theme="dark"] .attendance-tabs {
  background: rgba(18, 21, 27, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] .attendance-tab.is-active,
html[data-theme="dark"] .inventory-tab.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .attendance-tabs .attendance-tab.is-active::after {
  background: #c0742a !important;
}

html[data-theme="dark"] .attendance-filter-btn.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
  border-color: #c0742a !important;
  background: rgba(192, 116, 42, 0.16) !important;
}

html[data-theme="dark"] .attendance-filter-total {
  color: rgba(236, 236, 236, 0.9) !important;
  -webkit-text-fill-color: rgba(236, 236, 236, 0.9) !important;
}

html[data-theme="dark"] .attendance-filter-sep {
  color: rgba(219, 226, 236, 0.82) !important;
  -webkit-text-fill-color: rgba(219, 226, 236, 0.82) !important;
}

html[data-theme="dark"] .leave-summary-card {
  background: #1d222a;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .leave-summary-label {
  color: rgba(219, 226, 236, 0.72);
}

html[data-theme="dark"] .leave-summary-value {
  color: #e6ebf2;
}

html[data-theme="dark"] .attendance-table th + th,
html[data-theme="dark"] .account-table th + th {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .account-skeleton-line {
  background: linear-gradient(90deg, #2a3138 0%, #323a44 50%, #2a3138 100%);
  background-size: 200% 100%;
}

html[data-theme="dark"] .leave-status-pill {
  color: #dbe2ec;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .leave-table th {
  background: #242a33;
  color: #dbe2ec;
}

html[data-theme="dark"] .leave-status-pill.is-submitted {
  color: #f0ce6a;
  border-color: rgba(240, 206, 106, 0.55);
  background: rgba(240, 206, 106, 0.16);
}

html[data-theme="dark"] .leave-status-pill.is-cancelled {
  color: #e0b4b4;
  border-color: rgba(224, 180, 180, 0.5);
  background: rgba(224, 180, 180, 0.14);
}

html[data-theme="dark"] .leave-status-pill.is-approved {
  color: #8dd8b1;
  border-color: rgba(141, 216, 177, 0.45);
  background: rgba(141, 216, 177, 0.14);
}

html[data-theme="dark"] .leave-status-pill.is-rejected {
  color: #f1b0b0;
  border-color: rgba(241, 176, 176, 0.45);
  background: rgba(241, 176, 176, 0.14);
}

html[data-theme="dark"] .leave-approve {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.5) !important;
  background: transparent;
}

html[data-theme="dark"] .leave-approve:hover {
  color: #86efac;
  background: rgba(74, 222, 128, 0.18);
  border-color: rgba(74, 222, 128, 0.5) !important;
}

html[data-theme="dark"] .leave-cancel {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5) !important;
  background: transparent !important;
}

html[data-theme="dark"] .leave-cancel:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

html[data-theme="dark"] .leave-reject {
  color: var(--danger-accent);
  border-color: rgba(208, 122, 122, 0.5) !important;
  background: transparent !important;
}

html[data-theme="dark"] .leave-reject:hover {
  color: var(--danger-accent);
  background: rgba(208, 122, 122, 0.16) !important;
  border-color: rgba(208, 122, 122, 0.5) !important;
}

html[data-theme="dark"] .leave-mode-group {
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .leave-mode-group legend,
html[data-theme="dark"] .leave-apply-hint {
  color: #b8c0cb;
}

html[data-theme="dark"] .leave-footer-note {
  color: rgba(219, 226, 236, 0.86);
}

html[data-theme="dark"] .attendance-tab-divider {
  background: rgba(255, 255, 255, 0.35) !important;
}

html[data-theme="dark"] body.assistant-mode .assistant-chat::before {
  background: var(--page-bg);
}

html[data-theme="dark"] body.assistant-mode .assistant-chat::after {
  background: linear-gradient(to bottom, rgba(22, 22, 22, 0), var(--page-bg) 70%);
}

html[data-theme="dark"] .assistant-input,
html[data-theme="dark"] .assistant-source-pill,
html[data-theme="dark"] .assistant-table,
html[data-theme="dark"] .assistant-image-thumb,
html[data-theme="dark"] .assistant-generated-image,
html[data-theme="dark"] .assistant-generated-image-thumb,
html[data-theme="dark"] .history-thumb,
html[data-theme="dark"] .assistant-history-item,
html[data-theme="dark"] .assistant-file-chip {
  background: var(--panel-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .assistant-history-answer,
html[data-theme="dark"] .assistant-history-empty,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .history-preview-empty {
  color: var(--text-secondary);
}

html[data-theme="dark"] .assistant-generated-image-preview,
html[data-theme="dark"] .assistant-generated-image-action {
  background: var(--panel-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .assistant-history-remove,
html[data-theme="dark"] .history-thumb-remove {
  background: rgba(18, 22, 30, 0.9);
  color: #dbe2ec;
}

html[data-theme="dark"] .prompt-dialog-header,
html[data-theme="dark"] .prompt-dialog-footer,
html[data-theme="dark"] .prompt-dialog-inner,
html[data-theme="dark"] .prompt-tab,
html[data-theme="dark"] .prompt-dialog-more {
  background: var(--panel-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

html[data-theme="dark"] .prompt-area::placeholder {
  color: #8f99a8;
}

html[data-theme="dark"] .prompt-input-wrap .prompt-select-wrap .dropdown-trigger {
  border-color: var(--field-border);
}

html[data-theme="dark"] .prompt-tab.prompt-tab-add {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

html[data-theme="dark"] .prompt-dialog-image-slot {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .prompt-dialog-image-add {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .prompt-dialog-image-remove {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 30, 0.9);
  color: #dbe2ec;
}

html[data-theme="dark"] .prompt-dialog-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .section-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .mascot-spec,
html[data-theme="dark"] .anchor-nav,
html[data-theme="dark"] .empty-panel {
  background: var(--panel-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .mascot-spec hr {
  border-top-color: var(--border-soft);
}

html[data-theme="dark"] .mascot-spec blockquote {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .canvas-empty,
html[data-theme="dark"] .canvas-status,
html[data-theme="dark"] .canvas-loading,
html[data-theme="dark"] .audit-panel {
  background: var(--panel-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .canvas-output {
  background: var(--panel-bg) !important;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .canvas-output-dialog {
  background: transparent !important;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .prompt-card {
  background: var(--panel-bg);
}

html[data-theme="dark"] #canvas-host.is-loading {
  background: linear-gradient(
    100deg,
    #20252d 20%,
    #2a313b 45%,
    #20252d 70%
  );
}

html[data-theme="dark"] .canvas-empty p,
html[data-theme="dark"] .audit-status,
html[data-theme="dark"] .audit-progress {
  color: var(--text-secondary);
}

html[data-theme="dark"] .audit-item.pass {
  color: #6abf72;
}

html[data-theme="dark"] .audit-item.fail {
  color: #f28b82;
}

html[data-theme="dark"] .audit-item.warn {
  color: #fdd663;
}

html[data-theme="dark"] .rag-check-col,
html[data-theme="dark"] .rag-admin-table thead .rag-check-col {
  background: var(--table-row-bg);
}

html[data-theme="dark"] .rag-admin-table thead .rag-check-col {
  background: var(--table-head-bg);
}

html[data-theme="dark"] .rag-google-empty {
  background: var(--panel-elevated);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .inventory-kpi,
html[data-theme="dark"] .inventory-kpi h4,
html[data-theme="dark"] .inventory-kpi p,
html[data-theme="dark"] .inventory-panel h3,
html[data-theme="dark"] .inventory-panel p {
  color: var(--text-primary);
}

html[data-theme="dark"] .inventory-kpi p,
html[data-theme="dark"] .inventory-panel p {
  color: var(--text-secondary);
}

html[data-theme="dark"] .pos-search,
html[data-theme="dark"] .pos-card,
html[data-theme="dark"] .pos-card-image,
html[data-theme="dark"] .pos-tag,
html[data-theme="dark"] .pos-upload,
html[data-theme="dark"] .pos-upload-icon,
html[data-theme="dark"] .pos-qty,
html[data-theme="dark"] .pos-footer,
html[data-theme="dark"] .attendance-footer,
html[data-theme="dark"] #pos-info-dialog .account-dialog-actions,
html[data-theme="dark"] #pos-dialog .account-dialog-actions {
  background: var(--panel-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] #pos-info-image {
  background: var(--panel-elevated);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] #pos-info-image .pos-card-image-icon,
html[data-theme="dark"] .pos-card-image .pos-card-image-icon {
  color: var(--text-secondary);
}

html[data-theme="dark"] #pos-info-dialog .account-dialog-title {
  background: var(--panel);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .pos-info-barcode {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .pos-info-barcode.is-empty {
  background: var(--panel-elevated);
}

html[data-theme="dark"] #pos-info-dialog .pos-card-title,
html[data-theme="dark"] #pos-info-dialog .pos-card-price,
html[data-theme="dark"] #pos-info-dialog .pos-info-desc {
  color: var(--text-primary);
}

html[data-theme="dark"] #pos-info-dialog .pos-info-code,
html[data-theme="dark"] #pos-info-dialog .pos-info-barcode.is-empty {
  color: var(--text-secondary);
}

html[data-theme="dark"] .pos-stock-hint {
  color: var(--text-secondary);
}

html[data-theme="dark"] .pos-card.is-out-of-stock .pos-stock-hint {
  color: #f1b0b0;
}

html[data-theme="dark"] .pos-info-barcode svg,
html[data-theme="dark"] .pos-info-barcode rect,
html[data-theme="dark"] .pos-info-barcode text {
  color-scheme: light;
}

html[data-theme="dark"] .pos-payment-option {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text-primary);
}

html[data-theme="dark"] .pos-payment-option.is-selected {
  border-color: #5d8a71;
  background: rgba(93, 138, 113, 0.16);
  color: #d7eadc;
}

html[data-theme="dark"] .pos-qty-btn {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text-primary);
}

html[data-theme="dark"] .pos-qty-value {
  color: var(--text-primary);
}

html[data-theme="dark"] .pos-search-icon,
html[data-theme="dark"] .pos-tag,
html[data-theme="dark"] .pos-image-hint,
html[data-theme="dark"] .pos-upload {
  color: var(--text-secondary);
}

html[data-theme="dark"] .home-tool-body,
html[data-theme="dark"] .home-tool-body p,
html[data-theme="dark"] .home-tool-times,
html[data-theme="dark"] .home-tool-time-label,
html[data-theme="dark"] .home-tool-time-value,
html[data-theme="dark"] .home-tool-total,
html[data-theme="dark"] .home-tool-list-title,
html[data-theme="dark"] .home-tool-summary-label,
html[data-theme="dark"] .home-tools-empty {
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

html[data-theme="dark"] .home-tool-time-label {
  color: var(--text-secondary) !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
}

html[data-theme="dark"] .home-tool-list-item,
html[data-theme="dark"] .home-tool-summary-row {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .home-tool-schedule-tile {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(35, 40, 49, 0.92);
}

html[data-theme="dark"] .home-tool-schedule-tile.is-today {
  border-color: rgba(237, 175, 91, 0.72);
  box-shadow: inset 0 0 0 1px rgba(237, 175, 91, 0.24);
}

html[data-theme="dark"] .home-tool-schedule-weekday {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .home-tool-schedule-weekday.is-weekend {
  color: #ee7676;
}

html[data-theme="dark"] .home-tool-schedule-calendar-cell {
  border: none;
  background: transparent;
}

html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .home-tool-schedule-calendar-cell.is-empty {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .home-tool-schedule-calendar-cell.is-today {
  border-color: rgba(237, 175, 91, 0.72);
  box-shadow: inset 0 0 0 1px rgba(237, 175, 91, 0.24);
  border: 1px solid rgba(237, 175, 91, 0.72);
  background: rgba(62, 45, 28, 0.92);
}

html[data-theme="dark"] .home-tool-schedule-calendar-day {
  color: var(--text-primary);
}

html[data-theme="dark"] .home-tool-schedule-calendar-cell.has-event .home-tool-schedule-calendar-day {
  color: #ff9aa5;
}

html[data-theme="dark"] .home-tool-card--large .home-tool-schedule-calendar-cell.has-event .home-tool-schedule-calendar-day,
html[data-theme="dark"] .home-tool-card--xlarge .home-tool-schedule-calendar-cell.has-event .home-tool-schedule-calendar-day {
  color: #ff9aa5 !important;
  -webkit-text-fill-color: #ff9aa5 !important;
}

html[data-theme="dark"] .home-tool-schedule-event-chip {
  background: rgba(255, 154, 165, 0.15);
  color: #ff9aa5;
}

html[data-theme="dark"] .home-tool-schedule-more-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

html[data-theme="dark"] .home-tool-schedule-aside-title {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .home-tool-schedule-aside-item {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(35, 40, 49, 0.92);
}

html[data-theme="dark"] .home-tool-schedule-aside-item.is-today {
  border-color: rgba(237, 175, 91, 0.72);
  box-shadow: inset 0 0 0 1px rgba(237, 175, 91, 0.24);
}

html[data-theme="dark"] .home-tool-schedule-aside-date {
  color: var(--text-primary);
}

html[data-theme="dark"] .home-tool-card-skeleton-fill {
  background: linear-gradient(
    90deg,
    rgba(49, 56, 68, 0.9) 0%,
    rgba(61, 69, 82, 0.98) 50%,
    rgba(49, 56, 68, 0.9) 100%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .performance-mobile-card-skeleton h3,
html[data-theme="dark"] .performance-mobile-card-skeleton p,
html[data-theme="dark"] .performance-mobile-card-skeleton strong,
html[data-theme="dark"] .performance-mobile-card-skeleton span {
  color: transparent;
}

html[data-theme="dark"] .home-tool-list-meta,
html[data-theme="dark"] .home-tool-summary-value,
html[data-theme="dark"] .home-tool-list-empty,
html[data-theme="dark"] .home-tool-list-more {
  color: var(--text-secondary) !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
}

html[data-theme="dark"] .pos-card-delete {
  background: rgba(18, 22, 30, 0.95);
}

html[data-theme="dark"] .inventory-table-wrap table,
html[data-theme="dark"] .inventory-table-wrap th,
html[data-theme="dark"] .inventory-table-wrap td,
html[data-theme="dark"] .devtest-table-wrap table,
html[data-theme="dark"] .devtest-table-wrap th,
html[data-theme="dark"] .devtest-table-wrap td,
html[data-theme="dark"] .account-table-wrap th,
html[data-theme="dark"] .account-table-wrap td {
  color: var(--text-primary);
}

html[data-theme="dark"] .history-toggle:not(.assistant-history-toggle):not(.rag-qa-toggle) {
  background: #2a313b;
  border-color: rgba(255, 255, 255, 0.16);
  color: #e6ebf2;
}

html[data-theme="dark"] .history-toggle:not(.assistant-history-toggle):not(.rag-qa-toggle):hover {
  background: #323a46;
}

html[data-theme="dark"] .history-toggle-icon,
html[data-theme="dark"] .history-toggle svg {
  color: #e6ebf2;
  stroke: currentColor;
}

html[data-theme="dark"] .home-tool-more,
html[data-theme="dark"] .prompt-dialog-close,
html[data-theme="dark"] .dialog-close,
html[data-theme="dark"] .pos-dialog-close,
html[data-theme="dark"] .pos-dialog-edit {
  color: #dbe2ec;
}

html[data-theme="dark"] .home-tool-more {
  background: rgba(17, 21, 27, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .home-tool-edit-btn.is-active {
  background: rgba(192, 116, 42, 0.16);
  border-color: rgba(192, 116, 42, 0.52);
  color: #f0c187;
}

html[data-theme="dark"] .home-tool-more:hover,
html[data-theme="dark"] .prompt-dialog-close:hover,
html[data-theme="dark"] .dialog-close:hover,
html[data-theme="dark"] .pos-dialog-close:hover,
html[data-theme="dark"] .pos-dialog-edit:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .dialog-close svg {
  stroke: #dbe2ec;
}

html[data-theme="dark"] .custom-date-picker {
  background: #20252d;
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .custom-date-picker-backdrop.is-modal {
  background: rgba(10, 14, 20, 0.52);
}

html[data-theme="dark"] .custom-date-picker-title,
html[data-theme="dark"] .custom-date-picker-day {
  color: var(--text-primary);
}

html[data-theme="dark"] .custom-date-picker-weekdays span,
html[data-theme="dark"] .custom-date-picker-day.is-outside {
  color: var(--text-secondary);
}

html[data-theme="dark"] .custom-date-picker-weekdays span:first-child,
html[data-theme="dark"] .custom-date-picker-weekdays span:last-child {
  color: #ff8b8b;
}

html[data-theme="dark"] .custom-date-picker-nav,
html[data-theme="dark"] .custom-date-picker-action {
  background: #2a313b;
  border-color: var(--field-border);
  color: var(--text-primary);
}

html[data-theme="dark"] .custom-date-picker-day:hover,
html[data-theme="dark"] .custom-date-picker-nav:hover,
html[data-theme="dark"] .custom-date-picker-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .custom-date-picker-day.is-selected,
html[data-theme="dark"] .custom-date-picker-day.is-selected:hover {
  background: #c0742a;
  color: #fff;
}

html[data-theme="dark"] .dropdown-caret,
html[data-theme="dark"] .dropdown-trigger .dropdown-caret,
html[data-theme="dark"] .rag-share-dropdown .dropdown-caret,
html[data-theme="dark"] .rag-share-drive-email-dropdown .dropdown-caret,
html[data-theme="dark"] .rag-share-drive-role-dropdown .dropdown-caret {
  border-right-color: #e6ebf2 !important;
  border-bottom-color: #e6ebf2 !important;
}

/* Keep original accent semantics in dark mode (orange/red should not become grayscale). */
html[data-theme="dark"] .cta:not(:disabled),
html[data-theme="dark"] .inventory-btn.primary:not(:disabled),
html[data-theme="dark"] .inventory-move-open:not(:disabled),
html[data-theme="dark"] .btn.secondary.rag-open-upload-inline:not(:disabled),
html[data-theme="dark"] .prompt-rename-actions .btn.cta:not(:disabled),
html[data-theme="dark"] .pos-toolbar-actions .btn:not(.cta):not(:disabled) {
  background: #c0742a !important;
  border-color: #c0742a !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn.secondary.rag-open-upload-inline:hover,
html[data-theme="dark"] #rag-upload:not(:disabled):hover {
  background: #a8601f !important;
  border-color: #a8601f !important;
}

html[data-theme="dark"] .rag-upload-drop {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .rag-upload-icon {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .btn.danger,
html[data-theme="dark"] .account-dialog .btn.danger {
  background: var(--danger-accent) !important;
  border-color: var(--danger-accent) !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn.danger:hover,
html[data-theme="dark"] .account-dialog .btn.danger:hover {
  background: #c26e6e !important;
  border-color: #c26e6e !important;
}

html[data-theme="dark"] #account-delete-dialog .btn.danger,
html[data-theme="dark"] .account-table .account-delete {
  background: #b8742c !important;
  border-color: #b8742c !important;
}

html[data-theme="dark"] #account-delete-dialog .btn.danger:hover,
html[data-theme="dark"] .account-table .account-delete:hover {
  background: #d28b40 !important;
  border-color: #d28b40 !important;
}

html[data-theme="dark"] .account-table .account-action-dropdown-menu .account-delete:hover,
html[data-theme="dark"] .account-table .account-action-dropdown-menu .account-toggle.danger:hover {
  background: rgba(208, 122, 122, 0.12) !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .rag-admin-table .rag-delete-drive,
html[data-theme="dark"] .rag-admin-table .rag-remove {
  color: var(--danger-accent) !important;
  border-color: rgba(208, 122, 122, 0.5) !important;
}

html[data-theme="dark"] .rag-admin-table .rag-delete-drive:hover,
html[data-theme="dark"] .rag-admin-table .rag-remove:hover {
  background: rgba(208, 122, 122, 0.18) !important;
}

html[data-theme="dark"] .assistant-history-remove:hover,
html[data-theme="dark"] .history-thumb-remove:hover {
  background: var(--danger-accent) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pos-card-delete {
  color: var(--danger-accent) !important;
  border-color: rgba(208, 122, 122, 0.5) !important;
}

html[data-theme="dark"] .pos-card-delete:hover {
  background: rgba(208, 122, 122, 0.16) !important;
}

html[data-theme="dark"] .devtest-status.is-failed {
  color: var(--danger-accent) !important;
}

html[data-theme="dark"] .home-tool-punch.is-on:not(:disabled) {
  background: #c0742a !important;
  border-color: #c0742a !important;
  color: #fff !important;
}

/* Adapt green semantic actions for dark mode (keep green, improve contrast). */
html[data-theme="dark"] .btn:not(.secondary):not(.danger):not(.cta):not(.ghost):not(.home-tool-punch):not(.attendance-delete):not(.attendance-edit):not(.leave-cancel):not(.leave-approve):not(.leave-reject):not(.schedule-add-event-btn):not(:disabled),
html[data-theme="dark"] .home-tool-punch-in:not(:disabled),
html[data-theme="dark"] .home-tool-punch.is-off:not(:disabled),
html[data-theme="dark"] .btn.cta:not(:disabled),
html[data-theme="dark"] #rag-upload:not(:disabled),
html[data-theme="dark"] .assistant-send.is-ready,
html[data-theme="dark"] .assistant-send.is-sending,
html[data-theme="dark"] .rag-qa-send.is-ready,
html[data-theme="dark"] .rag-qa-send.is-sending {
  background: #5f8f78 !important;
  border-color: #5f8f78 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .attendance-action-dropdown .btn:not(:disabled),
html[data-theme="dark"] .performance-action-dropdown .btn:not(:disabled),
html[data-theme="dark"] .inventory-page .inventory-action-dropdown .inventory-btn.small:not(:disabled) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"] .inventory-page .inventory-action-dropdown .inventory-btn.small.danger:not(:disabled) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

html[data-theme="dark"] .inventory-page .inventory-action-dropdown .inventory-btn.small.danger:hover:not(:disabled) {
  background: rgba(242, 139, 130, 0.12) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

.performance-action-dropdown .performance-delete:not(:disabled) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

.performance-action-dropdown .performance-delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}

html[data-theme="dark"] .performance-action-dropdown .performance-delete:not(:disabled) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

html[data-theme="dark"] .performance-action-dropdown .performance-delete:hover:not(:disabled) {
  background: rgba(242, 139, 130, 0.12) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

html[data-theme="dark"] #pos-edit-button {
  background: #c0742a !important;
  border-color: #c0742a !important;
  color: #fff !important;
}

html[data-theme="dark"] #pos-add-button,
html[data-theme="dark"] #pos-next-button,
html[data-theme="dark"] #stop-button {
  background: #5f8f78 !important;
  border-color: #5f8f78 !important;
  color: #fff !important;
}

html[data-theme="dark"] .attendance-delete {
  color: var(--danger-accent) !important;
  border: 1px solid rgba(208, 122, 122, 0.68) !important;
  background: transparent !important;
}

html[data-theme="dark"] .attendance-delete:hover {
  background: rgba(208, 122, 122, 0.16) !important;
}

html[data-theme="dark"] .attendance-edit {
  color: #d6deeb !important;
  border: 1px solid rgba(214, 222, 235, 0.42) !important;
  background: transparent !important;
}

html[data-theme="dark"] .attendance-edit:hover {
  background: rgba(214, 222, 235, 0.12) !important;
}

html[data-theme="dark"] .home-tool-punch-out:not(:disabled) {
  background: #c0742a !important;
  border-color: #c0742a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .home-tool-punch-out.is-off:not(:disabled),
html[data-theme="dark"] .home-tool-punch-out.is-on:not(:disabled) {
  background: #c0742a !important;
  border-color: #c0742a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .assistant-send:not(.is-ready):not(.is-sending),
html[data-theme="dark"] .assistant-send:disabled,
html[data-theme="dark"] .rag-qa-send:not(.is-ready):not(.is-sending),
html[data-theme="dark"] .rag-qa-send:disabled {
  background: #343943 !important;
  color: #9ea7b4 !important;
}

.btn:disabled,
.cta:disabled {
  background: var(--btn-disabled-bg) !important;
  color: var(--btn-disabled-ink) !important;
  border-color: var(--btn-disabled-border) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .cta:disabled,
html[data-theme="dark"] #export-button:disabled,
html[data-theme="dark"] #stop-button:disabled {
  background: var(--btn-disabled-bg) !important;
  color: var(--btn-disabled-ink) !important;
  border-color: var(--btn-disabled-border) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .assistant-attach,
html[data-theme="dark"] .prompt-area-image-add {
  background: var(--field-bg) !important;
  border-color: var(--field-border) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .prompt-area-upload-chip {
  background: var(--field-bg) !important;
  border-color: var(--field-border) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .prompt-area-upload-chip button {
  color: rgba(230, 235, 242, 0.78) !important;
}

/* AI drawing page dark-mode hardening */
html[data-theme="dark"] .ai-dashboard .ai-tabs {
  background: var(--panel-elevated) !important;
  border-bottom-color: rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="dark"] .ai-dashboard .ai-tab {
  background: transparent !important;
  color: #dbe2ec !important;
  -webkit-text-fill-color: #dbe2ec !important;
}

html[data-theme="dark"] .ai-dashboard .ai-tab.is-active,
html[data-theme="dark"] .ai-dashboard .ai-tab[aria-selected="true"] {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .ai-dashboard .ai-tab.is-active::after,
html[data-theme="dark"] .ai-dashboard .ai-tab[aria-selected="true"]::after {
  background: #c0742a !important;
}

html[data-theme="dark"] .ai-dashboard .prompt-mini-card {
  background: var(--panel-elevated) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .ai-dashboard .theme-card {
  background: #1f242c !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

html[data-theme="dark"] .ai-dashboard .theme-card input:checked + span {
  color: #c0742a !important;
}

html[data-theme="dark"] .ai-dashboard .prompt-card-bottom {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .ai-dashboard .prompt-card-bottom {
    background: #161616 !important;
    border-top-color: rgba(255, 255, 255, 0.14) !important;
  }
}

html[data-theme="dark"] .text-button,
html[data-theme="dark"] .text-btn {
  color: #a4e8af !important;
  -webkit-text-fill-color: #a4e8af !important;
}

html[data-theme="dark"] .text-button:hover,
html[data-theme="dark"] .text-btn:hover {
  color: #bcf1c5 !important;
  -webkit-text-fill-color: #bcf1c5 !important;
}

html[data-theme="dark"] .assistant-history-toggle {
  background: #2a313b !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #e6ebf2 !important;
}

html[data-theme="dark"] .assistant-history-toggle:hover {
  background: #323a46 !important;
}

/* Inventory page: keep tabs row and active panel transparent in all themes. */
.inventory-tabs-row,
.inventory-panel.is-active,
html[data-theme="dark"] .inventory-tabs-row,
html[data-theme="dark"] .inventory-panel.is-active {
  background: transparent !important;
}

/* Dark mode: active tab orange override (counters !important from base dark rule) */
html[data-theme="dark"] .ai-tab.is-active,
html[data-theme="dark"] .ai-tab[aria-selected="true"] {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .ai-tab.is-active::after,
html[data-theme="dark"] .ai-tab[aria-selected="true"]::after {
  background: #c0742a !important;
}

html[data-theme="dark"] .prompt-tab.active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
  border-color: rgba(192, 116, 42, 0.5) !important;
}

html[data-theme="dark"] .pill-tab.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
  border-color: #c0742a !important;
}

html[data-theme="dark"] .pill-tab.pill-tab-add {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] .pill-tab-edit {
  color: inherit;
}

html[data-theme="dark"] .pos-skeleton-pill,
html[data-theme="dark"] .pos-card-skeleton-line,
html[data-theme="dark"] .pos-card-skeleton-image,
html[data-theme="dark"] .pos-card-skeleton-chip,
html[data-theme="dark"] .pos-card-skeleton-btn,
html[data-theme="dark"] .pos-card-skeleton-qty {
  background: linear-gradient(
    100deg,
    rgba(58, 67, 80, 0.72) 20%,
    rgba(86, 97, 112, 0.95) 45%,
    rgba(58, 67, 80, 0.72) 70%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .pos-category-dropdown .dropdown-trigger {
  background: var(--field-bg);
  border-color: var(--field-border);
}

html[data-theme="dark"] #pos-category-dialog #pos-category-delete {
  color: #f1b0b0 !important;
  -webkit-text-fill-color: #f1b0b0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #pos-category-dialog #pos-category-delete:hover {
  background: transparent !important;
}

html[data-theme="dark"] #pos-category-save:not(:disabled) {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-theme="dark"] #pos-category-save:not(:disabled):hover {
  background: #4f7c67 !important;
  border-color: #4f7c67 !important;
}

html[data-theme="dark"] #pos-save-button:not(:disabled),
html[data-theme="dark"] #pos-info-save:not(:disabled),
html[data-theme="dark"] #attendance-makeup-save:not(:disabled),
html[data-theme="dark"] #profile-edit-save:not(:disabled),
html[data-theme="dark"] #account-edit-save:not(:disabled),
html[data-theme="dark"] #inventory-edit-confirm:not(:disabled),
html[data-theme="dark"] .prompt-dialog-save:not(:disabled) {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-theme="dark"] #pos-save-button:not(:disabled):hover,
html[data-theme="dark"] #pos-info-save:not(:disabled):hover,
html[data-theme="dark"] #attendance-makeup-save:not(:disabled):hover,
html[data-theme="dark"] #profile-edit-save:not(:disabled):hover,
html[data-theme="dark"] #account-edit-save:not(:disabled):hover,
html[data-theme="dark"] #inventory-edit-confirm:not(:disabled):hover,
html[data-theme="dark"] .prompt-dialog-save:not(:disabled):hover {
  background: #4f7c67 !important;
  border-color: #4f7c67 !important;
}

html[data-theme="dark"] #rag-upload:not(:disabled) {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-theme="dark"] #rag-upload:not(:disabled):hover {
  background: #3f6b56 !important;
  border-color: #3f6b56 !important;
}

html[data-theme="dark"] .account-tab.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

html[data-theme="dark"] .inventory-move-tab.is-active {
  color: #c0742a !important;
  -webkit-text-fill-color: #c0742a !important;
}

/* Small screen: simple confirm dialogs — centered, 1rem margin, all-round radius, pop animation */
@media (max-width: 640px) {
  .account-dialog.dialog-confirm {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 1rem !important;
    border-radius: 0 !important;
  }

  .account-dialog.dialog-confirm[open] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .account-dialog.dialog-confirm .account-dialog-inner {
    border-radius: 16px !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: 90dvh !important;
  }

  .account-dialog.dialog-confirm[open] .account-dialog-inner {
    animation: dialog-pop 0.22s ease !important;
  }

  .account-dialog.dialog-confirm.is-closing .account-dialog-inner {
    animation: dialog-pop-out 0.18s ease forwards !important;
  }

  .prompt-delete-dialog {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 1rem !important;
    right: 1rem !important;
    width: auto !important;
    max-width: none !important;
    margin: auto !important;
    height: fit-content !important;
    border-radius: 16px !important;
    transform: scale(0.96) !important;
    opacity: 0 !important;
  }

  .prompt-delete-dialog[open] {
    display: block !important;
    transform: scale(1) !important;
    opacity: 1 !important;
  }
}

/* iOS Safari: remove blue tap highlight and focus ring on tabs */
.ai-tab,
.pill-tab,
.prompt-tab,
.account-tab,
.attendance-tab,
.inventory-move-tab {
  -webkit-tap-highlight-color: transparent;
}

.ai-tab:focus:not(:focus-visible),
.pill-tab:focus:not(:focus-visible),
.prompt-tab:focus:not(:focus-visible),
.account-tab:focus:not(:focus-visible),
.attendance-tab:focus:not(:focus-visible),
.inventory-move-tab:focus:not(:focus-visible) {
  outline: none;
}

/* Dark mode skeleton shimmer */
html[data-theme="dark"] #canvas-host.is-loading {
  background: linear-gradient(
    100deg,
    #2e2b28 20%,
    #3e3a36 45%,
    #2e2b28 70%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .history-thumb.is-skeleton {
  background: linear-gradient(
    100deg,
    #2e2b28 20%,
    #3e3a36 45%,
    #2e2b28 70%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .history-preview-item.is-loading::before {
  background: linear-gradient(
    100deg,
    #2e2b28 20%,
    #3e3a36 45%,
    #2e2b28 70%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .history-thumb.is-loading::before {
  background: linear-gradient(
    100deg,
    #2e2b28 20%,
    #3e3a36 45%,
    #2e2b28 70%
  );
  background-size: 200% 100%;
}

.social-marketing-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  align-items: stretch;
  min-height: calc(100dvh - var(--header-height, 68px) - 3rem);
  overflow: visible;
}

.social-marketing-dashboard > * {
  margin-bottom: 0 !important;
}

.social-marketing-card,
.social-marketing-output-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.social-marketing-card {
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.social-marketing-form-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.2rem 0;
}

.social-marketing-output-card {
  overflow: hidden;
  padding: 1.2rem;
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.social-marketing-head h2,
.social-marketing-output-head h3 {
  margin: 0;
}

.social-marketing-head p,
.social-marketing-output-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.social-marketing-inline {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.social-marketing-inline label,
.social-marketing-fields label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.social-marketing-inline input,
.social-marketing-fields input,
.social-marketing-fields select,
.social-marketing-fields textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.social-marketing-fields {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
  overflow: visible;
}

.social-marketing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sm-block {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
}

.sm-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.sm-block-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.sm-rows {
  display: grid;
  gap: 0.55rem;
}

.sm-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.45rem;
}

.sm-row .sm-remove-row {
  white-space: nowrap;
}

.social-marketing-fields textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.sm-add-dialog-form {
  margin-top: 0.5rem;
}

.sm-add-dialog-form label {
  display: grid;
  gap: 0.35rem;
}

.sm-add-dialog .account-dialog-actions {
  padding: 0 1rem 1rem;
}

.sm-add-dialog-form .dropdown.sm-dialog-dropdown {
  width: 100%;
  display: flex;
}

.sm-dialog-dropdown .dropdown-trigger {
  width: 100%;
  justify-content: space-between;
  min-height: 42px;
  height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0 0.75rem;
  background: #fff;
}

.sm-dialog-dropdown .dropdown-menu {
  left: 0;
  right: auto;
  min-width: 100%;
  z-index: 60;
}

.sm-dialog-dropdown.sm-dropdown-up .dropdown-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.social-marketing-actions {
  margin-top: 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 0.9rem 1.2rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--stroke);
  background: var(--panel-bg);
}

.social-marketing-readable {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.sm-summary-card,
.sm-post-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 0.9rem;
}

.sm-summary-card p,
.sm-post-card p {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.sm-post-card h4,
.sm-post-card h5 {
  margin: 0 0 0.4rem;
}

.sm-platform-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.sm-empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .social-marketing-dashboard {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .social-marketing-card,
  .social-marketing-output-card {
    height: auto;
    overflow: visible;
    display: flex;
  }

  .social-marketing-form-main {
    overflow: visible;
    padding-bottom: 0;
  }

  .social-marketing-card {
    grid-template-rows: none;
  }

  .social-marketing-actions {
    position: static;
  }

  .social-marketing-fields,
  .social-marketing-readable {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .social-marketing-inline {
    grid-template-columns: 1fr;
  }

  .social-marketing-grid {
    grid-template-columns: 1fr;
  }

  .sm-row {
    grid-template-columns: 1fr;
  }

  .sm-platform-row {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .social-marketing-inline input,
html[data-theme="dark"] .social-marketing-fields input,
html[data-theme="dark"] .social-marketing-fields select,
html[data-theme="dark"] .social-marketing-fields textarea {
  background: #111417;
  border-color: #2a3138;
  color: #edf2f6;
}

body.customer-service-page .customer-service-dashboard {
  display: flex;
  flex-direction: column;
}

.customer-service-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.customer-service-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  border: none;
  box-shadow: none;
}

.customer-service-tabs {
  margin: 0;
  margin-bottom: 0;
  gap: 0.75rem;
}

.customer-service-tab {
  min-width: 5.5rem;
}

.customer-service-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.customer-service-card-head h3 {
  margin: 0;
}

.customer-service-card-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.customer-service-source {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(200, 173, 112, 0.12);
  color: #8f6b2e;
  font-size: 0.92rem;
  font-weight: 700;
}

.customer-service-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.customer-service-channel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-soft);
}

.customer-service-preview-card {
  gap: 1rem;
}

.customer-service-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.customer-service-preview-head > div {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0.4rem;
}

.customer-service-channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.customer-service-channel-head h4,
.customer-service-section-head h4 {
  margin: 0;
}

.customer-service-channel > p {
  margin: 0;
  color: var(--muted);
}

.customer-service-channel-meta {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-service-channel-meta li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.customer-service-channel-meta span {
  color: var(--muted);
}

.customer-service-channel-meta strong {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
  word-break: break-all;
}

.customer-service-preview-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.customer-service-preview-enabled {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  background: rgba(148, 156, 168, 0.14);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.customer-service-preview-enabled.is-enabled {
  background: rgba(94, 143, 109, 0.14);
  color: #2d6b43;
}

.customer-service-preview-connection {
  color: var(--muted);
  font-size: 0.92rem;
}

.customer-service-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(160, 160, 160, 0.16);
  color: var(--muted);
}

.customer-service-status-pill.is-ready {
  background: rgba(200, 173, 112, 0.14);
  color: #8f6b2e;
}

.customer-service-status-pill.is-connected {
  background: rgba(94, 143, 109, 0.18);
  color: #2d6b43;
}

.customer-service-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-service-form .dropdown {
  width: 100%;
}

.customer-service-form .dropdown-trigger {
  width: 100%;
  justify-content: space-between;
  min-height: 48px;
}

.customer-service-form .dropdown-menu {
  max-height: min(280px, 40vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.customer-service-edit-trigger {
  flex: 0 0 auto;
}

.customer-service-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-service-channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.customer-service-panel-actions {
  display: flex;
  justify-content: flex-end;
}

.customer-service-empty {
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-soft);
}

.customer-service-panel[hidden] {
  display: none !important;
}

.customer-service-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.customer-service-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.customer-service-form-span-2 {
  grid-column: span 2;
}

.customer-service-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.customer-service-edit-inner {
  width: min(720px, calc(100vw - 2rem));
  max-height: min(84vh, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-service-edit-dialog .account-dialog-header {
  flex: 0 0 auto;
}

.customer-service-edit-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.customer-service-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-service-edit-panel[hidden] {
  display: none !important;
}

.customer-service-textarea {
  width: 100%;
  min-height: 108px;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  resize: vertical;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

#customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
#customer-service-edit-dialog .customer-service-form-grid .dropdown-trigger {
  min-height: 48px;
}

#customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: none;
}

#customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover:not(:disabled):not([readonly]) {
  border-color: color-mix(in srgb, var(--line) 76%, var(--accent) 24%);
}

#customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}

.customer-service-textarea:hover:not(:disabled):not([readonly]) {
  border-color: color-mix(in srgb, var(--line) 76%, var(--accent) 24%);
}

.customer-service-textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}

#customer-service-edit-dialog .account-dialog-actions-fixed {
  flex: 0 0 auto;
  background: inherit;
  border-top: 1px solid rgba(42, 34, 28, 0.08);
  padding: 0.9rem 1rem;
}

#customer-service-edit-dialog .account-dialog-actions-fixed .btn {
  flex: 0 0 auto;
}

html[data-theme="dark"] .customer-service-textarea {
  background: #20262f;
  border-color: #3a414c;
  color: #edf2f6;
}

html[data-theme="dark"] #customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  background: #20262f;
  border-color: #3a414c;
  color: #edf2f6;
}

html[data-theme="dark"] #customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover:not(:disabled):not([readonly]) {
  border-color: #5f6774;
}

html[data-theme="dark"] #customer-service-edit-dialog .customer-service-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible {
  border-color: #8aa4ff;
  outline-color: rgba(138, 164, 255, 0.28);
}

html[data-theme="dark"] .customer-service-textarea:hover:not(:disabled):not([readonly]) {
  border-color: #5f6774;
}

html[data-theme="dark"] .customer-service-textarea:focus-visible {
  border-color: #8aa4ff;
  outline-color: rgba(138, 164, 255, 0.28);
}

html[data-theme="dark"] #customer-service-edit-dialog .account-dialog-actions-fixed {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.customer-service-textarea::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] .customer-service-textarea::placeholder {
  color: #9aa4b1;
}

#customer-service-edit-dialog .dropdown.account-role-dropdown .dropdown-menu {
  top: calc(100% + 6px) !important;
  bottom: auto !important;
  left: 0;
  right: 0;
  width: 100%;
  min-width: 100%;
  z-index: 20;
  max-height: min(280px, 40vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1280px) {
  .customer-service-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .customer-service-channel-grid,
  .customer-service-channel-list,
  .customer-service-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-service-form-span-2 {
    grid-column: auto;
  }

  .customer-service-card-head,
  .customer-service-actions,
  .customer-service-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-service-edit-trigger {
    width: 100%;
  }

  .customer-service-panel-actions .btn {
    width: 100%;
  }

  #customer-service-edit-dialog .account-dialog-actions-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: inherit;
    border-top: 1px solid rgba(42, 34, 28, 0.08);
    border-radius: 0;
  }

  html[data-theme="dark"] #customer-service-edit-dialog .account-dialog-actions-fixed {
    border-top-color: rgba(255, 255, 255, 0.08);
  }
}

html[data-theme="dark"] .customer-service-channel {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .customer-service-empty {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .customer-service-source {
  background: rgba(200, 173, 112, 0.16);
  color: #d4b47c;
}

html[data-theme="dark"] .customer-service-status-pill.is-ready {
  color: #d4b47c;
}

html[data-theme="dark"] .customer-service-status-pill.is-connected {
  background: rgba(94, 143, 109, 0.24);
  color: #9dc8aa;
}

html[data-theme="dark"] .customer-service-preview-enabled {
  background: rgba(255, 255, 255, 0.06);
  color: #b8c2cf;
}

html[data-theme="dark"] .customer-service-preview-enabled.is-enabled {
  background: rgba(94, 143, 109, 0.24);
  color: #9dc8aa;
}

html[data-theme="dark"] .sm-block {
  background: #12171d;
  border-color: #2a3138;
}

html[data-theme="dark"] .sm-dialog-dropdown .dropdown-trigger {
  background: #111417;
  border-color: #2a3138;
  color: #edf2f6;
}

html[data-theme="dark"] .sm-summary-card,
html[data-theme="dark"] .sm-post-card {
  background: #111417;
  border-color: #2a3138;
}

@media (max-width: 1280px) {
  .dashboard-has-tabs {
    padding-top: 4rem !important;
  }

  body.schedule-page .schedule-dashboard {
    padding: 4rem 1rem calc(6rem + env(safe-area-inset-bottom, 0px));
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  body.schedule-page .schedule-add-open-wrap {
    z-index: 20;
  }

  .shell.menu-open .schedule-add-open-wrap,
  body:has(.rag-qa-panel.open) .schedule-add-open-wrap {
    display: none;
  }
}

@media (max-width: 960px) {
  .schedule-main-grid,
  .schedule-admin-grid {
    grid-template-columns: 1fr;
  }

  .schedule-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-hero-meta,
  .schedule-time-grid {
    grid-template-columns: 1fr;
  }

  .schedule-calendar-toolbar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .schedule-calendar-heading {
    text-align: center;
  }

  .schedule-manage-toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .devtest-manual-grid {
    grid-template-columns: 1fr;
  }

  .schedule-create-dialog:not([open]),
  #schedule-detail-dialog:not([open]) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  .schedule-create-dialog {
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: none;
  }

  .schedule-create-dialog[open],
  #schedule-detail-dialog[open] {
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  .schedule-create-inner,
  #schedule-detail-dialog .account-dialog-inner {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100dvh - var(--header-height, 68px)) !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
  }

  .schedule-create-body,
  .schedule-detail-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .schedule-create-body {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px 16px;
  }

  .schedule-create-body .schedule-create-panel {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }

  .schedule-create-body .schedule-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }

  .schedule-create-dialog[open] .schedule-create-inner,
  #schedule-detail-dialog[open] .account-dialog-inner {
    animation: dialog-slide-up 0.28s ease;
  }

  .schedule-create-dialog.is-closing .schedule-create-inner,
  #schedule-detail-dialog.is-closing .account-dialog-inner {
    animation: dialog-slide-down 0.2s ease forwards;
  }

  #schedule-detail-dialog .schedule-detail-actions {
    position: sticky;
    bottom: 0;
    background: var(--panel-bg);
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .schedule-create-dialog[open] .schedule-create-inner > .account-dialog-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    margin: 0;
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
    background: inherit;
    border-top: 1px solid rgba(42, 34, 28, 0.08);
  }

  html[data-theme="dark"] .schedule-create-dialog[open] .schedule-create-inner > .account-dialog-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  .schedule-calendar-card {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .schedule-day-card,
  .schedule-fixed-card {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .schedule-add-open-wrap {
    justify-content: stretch;
    padding: 0.75rem 1.5rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    display: flex;
    gap: 0.5rem;
    column-gap: 0.5rem;
  }

  .schedule-add-open {
    flex: 1;
    pointer-events: auto;
  }

  .schedule-add-open-wrap > .schedule-add-open + .schedule-add-open {
    margin-left: 0.5rem;
  }

  .schedule-cta-group {
    width: 100%;
  }

  .schedule-calendar-weekdays,
  .schedule-calendar-grid {
    gap: 0.45rem;
  }

  .schedule-calendar-grid,
  .schedule-calendar-day {
    touch-action: pan-y;
  }

  .schedule-calendar-day {
    min-height: 60px;
    padding: 0.45rem;
    border-radius: 14px;
  }

  .schedule-calendar-day-body {
    min-width: 0;
    gap: 0.3rem;
  }

  .schedule-calendar-day-body .schedule-member-badge,
  .schedule-calendar-day-body .schedule-calendar-chip {
    display: inline-flex;
    width: 12px;
    height: 12px;
    min-width: 12px;
    padding: 0;
    border-radius: 999px;
    background: currentColor;
    border: 1px solid currentColor;
    opacity: 1;
    overflow: hidden;
    text-indent: -9999px;
    white-space: nowrap;
    justify-self: start;
  }

  .schedule-item-main,
  .schedule-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-day-card .schedule-panel-head {
    flex-direction: row;
    align-items: center;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-1,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-2,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-3,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-4,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-5,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-6,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-7,
  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-8 {
    border-width: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-1 {
    background: #5da9ff;
    color: #5da9ff;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-2 {
    background: #4fd18b;
    color: #4fd18b;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-3 {
    background: #ffb454;
    color: #ffb454;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-4 {
    background: #c68cff;
    color: #c68cff;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-5 {
    background: #ff7f96;
    color: #ff7f96;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-6 {
    background: #42d4d6;
    color: #42d4d6;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-7 {
    background: #ffd84d;
    color: #ffd84d;
  }

  html[data-theme="dark"] .schedule-calendar-day-body .schedule-member-badge-8 {
    background: #c7d2e0;
    color: #c7d2e0;
  }
}

@media (min-width: 1536px) {
  body.pos-page .dashboard,
  body.social-marketing-page .dashboard,
  body.inventory-page .dashboard,
  body.attendance-page .dashboard,
  body.schedule-page .dashboard,
  body.leave-page .dashboard,
  body.profile-page .dashboard,
  body.employee-accounts-page .dashboard,
  body.devtest-page .dashboard {
    left: 260px;
    right: 0;
    width: auto;
    max-width: none;
  }
}

html[data-theme="dark"] .performance-action-dropdown #performance-action-delete:not(:disabled) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

html[data-theme="dark"] .performance-action-dropdown #performance-action-delete:hover:not(:disabled) {
  background: rgba(242, 139, 130, 0.12) !important;
  border: none !important;
  box-shadow: none !important;
  color: #f28b82 !important;
  -webkit-text-fill-color: #f28b82 !important;
}

html[data-theme="dark"] #pos-save-button:not(:disabled),
html[data-theme="dark"] #pos-info-save:not(:disabled),
html[data-theme="dark"] #pos-category-save:not(:disabled),
html[data-theme="dark"] #attendance-makeup-save:not(:disabled),
html[data-theme="dark"] #profile-edit-save:not(:disabled),
html[data-theme="dark"] #account-edit-save:not(:disabled),
html[data-theme="dark"] #inventory-edit-confirm:not(:disabled),
html[data-theme="dark"] #promotion-save-button:not(:disabled),
html[data-theme="dark"] .prompt-dialog-save:not(:disabled) {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-theme="dark"] #pos-save-button:not(:disabled):hover,
html[data-theme="dark"] #pos-info-save:not(:disabled):hover,
html[data-theme="dark"] #pos-category-save:not(:disabled):hover,
html[data-theme="dark"] #attendance-makeup-save:not(:disabled):hover,
html[data-theme="dark"] #profile-edit-save:not(:disabled):hover,
html[data-theme="dark"] #account-edit-save:not(:disabled):hover,
html[data-theme="dark"] #inventory-edit-confirm:not(:disabled):hover,
html[data-theme="dark"] #promotion-save-button:not(:disabled):hover,
html[data-theme="dark"] .prompt-dialog-save:not(:disabled):hover {
  background: #4f7c67 !important;
  border-color: #4f7c67 !important;
}
