:root {
  --bg: #e8f4ff;
  --surface: #ffffff;
  --surface-soft: #f5fbff;
  --ink: #173452;
  --text: #173452;
  --muted: #5f7894;
  --line: #cfe5f6;
  --primary: #1f7ed0;
  --primary-dark: #0f67b3;
  --blue: #3aa0ff;
  --teal: #2ab3e6;
  --lake-soft: #e2f4ff;
  --lake-glow: rgba(31, 126, 208, 0.2);
  --amber: #bd7a2a;
  --rose: #ba514c;
  --green: #168f8f;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(217, 226, 231, 0.72);
  --radius-card: 28px;
  --radius-soft: 20px;
  --shadow: 0 28px 80px rgba(23, 75, 125, 0.13);
  --shadow-soft: 0 14px 38px rgba(23, 75, 125, 0.09);
  --shadow-glass: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 50px rgba(23, 75, 125, 0.1);
  --toolbar-account-width: auto;
  --toolbar-control-width: 154px;
  --toolbar-period-width: 156px;
  --toolbar-settings-width: 98px;
  --toolbar-control-height: 52px;
  --sidebar-width: 300px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(31, 126, 208, 0.22), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(58, 160, 255, 0.2), transparent 28%),
    radial-gradient(circle at 78% 74%, rgba(42, 179, 230, 0.14), transparent 32%),
    linear-gradient(180deg, #e2f3ff 0, #f7fbff 360px, #e8f4ff 100%),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 30% 18%, rgba(31, 126, 208, 0.24), transparent 34%),
    radial-gradient(circle at 76% 12%, rgba(58, 160, 255, 0.18), transparent 30%),
    rgba(232, 244, 255, 0.92);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 250, 0.72)),
    rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-card .brand-mark {
  justify-self: center;
  width: 64px;
  height: 64px;
}

.auth-card h1,
.auth-card p {
  text-align: center;
}

.auth-card h1 {
  font-size: 25px;
}

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

.auth-card label,
.account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-card input,
.account-form input,
.account-form textarea,
.account-form select,
.account-table input,
.account-table select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(217, 226, 231, 0.95);
  border-radius: 13px;
  padding: 0 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-weight: 850;
}

.auth-card small {
  min-height: 18px;
  color: var(--rose);
  font-weight: 900;
}

.auth-card small.is-info {
  color: var(--primary-dark);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #7d94aa;
  font-size: 12px;
  font-weight: 900;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(207, 229, 246, 0.95);
}

.hikiot-sso-btn {
  border: 1px solid rgba(31, 126, 208, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 244, 255, 0.9)),
    #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(23, 75, 125, 0.08);
}

.auth-note {
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 100vh;
  padding: 22px 16px 22px 16px;
  overflow-x: scroll;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(123, 216, 232, 0.62) rgba(255, 255, 255, 0.06);
  color: #f4fbfd;
  background:
    radial-gradient(circle at 20% 0, rgba(173, 224, 255, 0.24), transparent 35%),
    linear-gradient(180deg, rgba(31, 126, 208, 0.32), transparent 42%),
    linear-gradient(180deg, #0f72b8, #0d5f9e);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 16px 0 44px rgba(23, 93, 157, 0.18);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 22%, rgba(0, 0, 0, 0.16));
  mix-blend-mode: screen;
  opacity: 0.62;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar::-webkit-scrollbar,
.org-list::-webkit-scrollbar,
.org-person-list::-webkit-scrollbar,
.profile-list::-webkit-scrollbar,
.schedule-list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.preview-scroll::-webkit-scrollbar,
.sms-template-list::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.sidebar::-webkit-scrollbar-track,
.org-list::-webkit-scrollbar-track,
.org-person-list::-webkit-scrollbar-track,
.profile-list::-webkit-scrollbar-track,
.schedule-list::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.preview-scroll::-webkit-scrollbar-track,
.sms-template-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb,
.org-list::-webkit-scrollbar-thumb,
.org-person-list::-webkit-scrollbar-thumb,
.profile-list::-webkit-scrollbar-thumb,
.schedule-list::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.preview-scroll::-webkit-scrollbar-thumb,
.sms-template-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(123, 216, 232, 0.95), rgba(43, 143, 210, 0.82))
    padding-box;
  box-shadow: 0 0 18px rgba(123, 216, 232, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.org-list::-webkit-scrollbar-thumb:hover,
.org-person-list::-webkit-scrollbar-thumb:hover,
.profile-list::-webkit-scrollbar-thumb:hover,
.schedule-list::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.preview-scroll::-webkit-scrollbar-thumb:hover,
.sms-template-list::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(159, 238, 229, 1), rgba(86, 139, 224, 0.95))
    padding-box;
}

.brand-mark {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(31, 126, 208, 0.24));
}

.brand-logo {
  flex: 0 0 auto;
  user-select: none;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
}

.topbar-brand > div {
  min-width: 0;
}

#analysis-title {
  white-space: nowrap;
}

.topbar-logo {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(31, 126, 208, 0.2));
}

.side-section {
  margin-top: 0;
}

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

.side-title {
  color: #b3d3dc;
  font-size: 12px;
  font-weight: 900;
}

.org-search {
  position: relative;
  margin-right: 4px;
  margin-bottom: 12px;
}

.org-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(173, 224, 235, 0.2);
  border-radius: 16px;
  padding: 0 42px 0 13px;
  outline: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.08);
  color: #f4fbfd;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.org-search input::placeholder {
  color: rgba(213, 235, 240, 0.62);
}

.org-search input:focus {
  border-color: rgba(123, 216, 232, 0.64);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(123, 216, 232, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.org-search button {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(173, 224, 235, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #d5ebf0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.org-search button:hover {
  border-color: rgba(123, 216, 232, 0.54);
  background: rgba(123, 216, 232, 0.12);
}

.org-search-summary {
  min-height: 18px;
  margin-bottom: 10px;
  color: #93c2ce;
  font-size: 12px;
  font-weight: 800;
}

.tree-item,
.org-button,
.org-person-button,
.org-root,
.org-group-head {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: #edf6f5;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.tree-item:hover,
.org-button:hover,
.org-person-button:hover,
.org-root:hover,
.org-group-head:hover,
.tree-item.is-active,
.org-button.is-active,
.org-person-button.is-active,
.org-root.is-active,
.org-group-head.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tree-item.is-active,
.org-button.is-active,
.org-person-button.is-active,
.org-root.is-active,
.org-group-head.is-active {
  box-shadow: inset 3px 0 0 #7bd8e8;
}

.tree-item strong,
.org-root strong,
.org-group-head strong {
  flex: 0 0 auto;
  margin-left: 14px;
  color: #d3e9ef;
  font-size: 12px;
}

.org-list {
  max-height: calc(100vh - 204px);
  overflow: auto;
  margin-right: -4px;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 216, 232, 0.62) rgba(255, 255, 255, 0.04);
  scrollbar-gutter: stable;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.org-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-button small {
  flex: 0 0 auto;
  margin-left: 12px;
  color: #b9c7cf;
}

.empty-side {
  color: #9fb1bd;
  font-size: 13px;
  line-height: 1.7;
}

.org-tree {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
}

.org-root {
  min-height: 48px;
  padding-inline: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(135deg, rgba(123, 216, 232, 0.18), rgba(43, 143, 210, 0.12)),
    rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 26px rgba(0, 0, 0, 0.12);
  font-weight: 950;
}

.org-root.ghost {
  cursor: default;
  opacity: 0.76;
}

.org-branches {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 14px;
}

.org-branches::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(123, 216, 232, 0.82), rgba(43, 143, 210, 0.34), rgba(123, 216, 232, 0.1));
}

.org-group {
  position: relative;
}

.org-group::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 20px;
  width: 9px;
  height: 1px;
  background: rgba(123, 216, 232, 0.54);
}

.org-group-head {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.08);
  font-weight: 950;
}

.org-group-head-wrap {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.org-toggle,
.org-people-toggle,
.icon-btn {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  cursor: pointer;
}

.org-toggle {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(123, 216, 232, 0.18), rgba(43, 143, 210, 0.1)),
    rgba(255, 255, 255, 0.07);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease, border-color 0.2s ease;
}

.org-toggle span,
.org-people-toggle span {
  width: 9px;
  height: 9px;
  border-right: 2px solid #e1f8fb;
  border-bottom: 2px solid #e1f8fb;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.org-toggle:hover,
.org-people-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.org-group.is-collapsed .org-toggle span {
  transform: rotate(-45deg) translate(-1px, 1px);
}

.org-group.office .org-group-head {
  background: rgba(123, 216, 232, 0.1);
}

.org-group.community .org-group-head {
  background: rgba(43, 143, 210, 0.12);
}

.org-group.resident .org-group-head {
  background: rgba(98, 181, 196, 0.12);
}

.org-children {
  position: relative;
  display: grid;
  gap: 5px;
  margin: 7px 0 0 13px;
  padding-left: 13px;
  max-height: 680px;
  overflow: hidden;
  opacity: 1;
  transform-origin: top;
  transition: max-height 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease, transform 0.28s ease, margin 0.28s ease;
}

.org-children::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.org-children .org-button {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 14px;
  color: #d9e7eb;
  font-size: 12px;
}

.org-children .org-button::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(123, 216, 232, 0.72);
  box-shadow: 0 0 0 4px rgba(123, 216, 232, 0.1);
}

.org-children .org-button small {
  color: #aebfc7;
}

.org-node {
  display: grid;
  gap: 5px;
}

.org-node-head {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.org-people-toggle {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.22s ease, background 0.18s ease, border-color 0.18s ease;
}

.org-people-toggle span {
  width: 7px;
  height: 7px;
  border-width: 1.6px;
  transform: rotate(-45deg) translate(-1px, 1px);
}

.org-node.is-expanded .org-people-toggle span {
  transform: rotate(45deg) translate(-1px, -1px);
}

.org-person-list {
  display: grid;
  gap: 4px;
  margin-left: 31px;
  padding-left: 10px;
  max-height: 0;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: scaleY(0.96);
  transform-origin: top;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 216, 232, 0.62) rgba(255, 255, 255, 0.05);
  transition: max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease, transform 0.22s ease;
}

.org-node.is-expanded .org-person-list {
  max-height: min(380px, 42vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-gutter: stable;
  opacity: 1;
  transform: scaleY(1);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 16px), transparent 100%);
}

.org-person-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 13px;
  color: #cfdee4;
  font-size: 12px;
}

.org-person-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-person-button small {
  flex: 0 0 auto;
  margin-left: 10px;
  color: #90a5ae;
}

.org-group.is-collapsed .org-children {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: scaleY(0.96);
}

.org-tree-placeholder {
  display: grid;
  gap: 12px;
}

.main {
  min-width: 0;
  padding: 32px 36px 48px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 16px;
  min-height: 94px;
  padding: 14px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 251, 252, 0.72)),
    var(--glass-strong);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(22px) saturate(1.25);
}

.topbar > div:first-child {
  min-width: max-content;
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  line-height: 1.22;
  font-weight: 950;
}

.topbar p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: var(--toolbar-control-height);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 950;
  box-shadow: none;
}

.user-chip button {
  width: 56px;
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  border: 0;
  border-radius: 16px;
  padding: 0 10px;
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  box-shadow: 0 12px 24px rgba(31, 126, 208, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: white;
  cursor: pointer;
  font-weight: 950;
  white-space: nowrap;
}

.mode-switch {
  position: relative;
  display: flex;
  width: var(--toolbar-control-width);
  height: var(--toolbar-control-height);
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.54)),
    rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
  --indicator-x: 5px;
  --indicator-w: 58px;
}

.mode-switch::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--indicator-w);
  border-radius: 13px;
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  box-shadow: 0 10px 22px rgba(31, 126, 208, 0.22);
  transform: translateX(var(--indicator-x));
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mode-switch button {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.22s ease;
}

.mode-switch button.is-active {
  color: white;
  background: transparent;
  transform: translateY(-1px);
}

.toolbar .mode-switch {
  display: none;
}

.period-picker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: var(--toolbar-control-height);
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.period-picker.is-open {
  z-index: 120;
}

.period-display,
.period-calendar-btn {
  height: 42px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.period-display {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 96px;
  padding: 0 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.period-display span {
  font-size: 11px;
  font-weight: 900;
}

.period-display strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 950;
}

.period-calendar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 70px;
  padding: 0 9px;
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: white;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(31, 126, 208, 0.2);
}

.period-calendar-btn:hover {
  background: linear-gradient(135deg, #176fbd, #278fe8);
}

.calendar-icon {
  position: relative;
  width: 14px;
  height: 14px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  opacity: 0.92;
}

.calendar-icon::before,
.calendar-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  height: 1.8px;
  border-radius: 999px;
  background: currentColor;
}

.calendar-icon::before {
  top: 3px;
}

.calendar-icon::after {
  top: 7px;
  opacity: 0.72;
}

.period-legacy-controls {
  display: none;
}

.quarter-control {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.period-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 140;
  width: 360px;
  padding: 14px;
  border: 1px solid rgba(208, 221, 226, 0.98);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 74px rgba(23, 32, 51, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.88) inset;
  isolation: isolate;
}

.period-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.period-popover-head div {
  display: grid;
  gap: 4px;
}

.period-popover-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.period-popover-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-close {
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

.period-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.period-date-fields label {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(217, 226, 231, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.period-date-fields span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.period-date-fields input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 950;
}

.period-calendar {
  display: grid;
  gap: 10px;
}

.period-calendar-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.period-calendar-head strong {
  color: var(--ink);
  text-align: center;
  font-size: 14px;
  font-weight: 950;
}

.period-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.period-weekday,
.period-day {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 950;
}

.period-weekday {
  color: var(--muted);
  height: 24px;
}

.period-day {
  border: 1px solid transparent;
  background: #f5f8f9;
  cursor: pointer;
}

.period-day.has-data {
  background: #fff;
  color: #0f67b3;
}

.period-day.no-data {
  background: #f4f6f7;
  color: #a8b3bb;
}

.period-day:not(.is-empty):hover {
  border-color: rgba(31, 126, 208, 0.32);
  background: rgba(232, 244, 255, 0.95);
}

.period-day.is-in-range {
  border-color: rgba(31, 126, 208, 0.32);
  background: #e8f4ff;
}

.period-day.is-start,
.period-day.is-end {
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: white;
}

.period-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.period-calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.period-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.period-calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.period-calendar-legend i.has-data {
  background: #1f7ed0;
}

.period-calendar-legend i.no-data {
  background: #a8b3bb;
}

.period-calendar-legend i.in-range {
  border-radius: 3px;
  background: rgba(123, 216, 232, 0.48);
}

.period-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: white;
  box-shadow: 0 12px 26px rgba(31, 126, 208, 0.24);
}

.btn.secondary {
  background: #e8f4ff;
  color: #0f67b3;
}

.btn.ghost {
  border: 1px solid rgba(217, 226, 231, 0.92);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.btn.danger-soft {
  border: 1px solid rgba(186, 81, 76, 0.24);
  background: rgba(255, 244, 243, 0.78);
  color: #a34742;
}

.toolbar-tool {
  width: var(--toolbar-settings-width);
  height: var(--toolbar-control-height);
  min-height: var(--toolbar-control-height);
  padding: 0 10px;
  border-radius: 16px;
  white-space: nowrap;
  color: #0f67b3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.toolbar-tool:hover {
  color: var(--primary-dark);
  border-color: rgba(31, 126, 208, 0.3);
  background: rgba(255, 255, 255, 0.78);
}

.toolbar-tool.is-active {
  border-color: rgba(31, 126, 208, 0.34);
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: white;
  box-shadow: 0 12px 24px rgba(31, 126, 208, 0.22);
}

.btn:hover {
  filter: brightness(0.98);
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 16px;
  margin-bottom: 18px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.3)),
    rgba(255, 255, 255, 0.36);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(24px) saturate(1.35);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 42%;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent);
}

.drop-zone {
  min-height: 184px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border: 1px dashed rgba(88, 111, 122, 0.5);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(24, 138, 164, 0.13), rgba(43, 143, 210, 0.09)),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
}

.drop-zone.is-dragging {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(24, 138, 164, 0.14), rgba(43, 143, 210, 0.1)),
    #ffffff;
}

.drop-zone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: #e1f8fb;
  font-size: 34px;
  font-weight: 950;
}

.drop-zone strong {
  font-size: 20px;
}

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

.upload-audit {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.25);
}

.audit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audit-head b,
.audit-head span {
  display: block;
}

.audit-head b {
  font-size: 16px;
  font-weight: 950;
}

.audit-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.audit-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f5;
  color: #53616b;
  font-size: 12px;
  font-weight: 950;
}

.audit-badge.is-success {
  background: rgba(22, 131, 95, 0.12);
  color: var(--green);
}

.audit-badge.is-danger {
  background: rgba(186, 81, 76, 0.12);
  color: var(--rose);
}

.archive-coverage-box {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}

.archive-coverage-box strong {
  color: var(--ink);
  font-size: 14px;
}

.archive-coverage-box span {
  color: var(--muted);
}

.archive-period-line {
  padding-top: 4px;
  font-weight: 950;
}

.archive-period-line.is-good {
  color: var(--green);
}

.archive-period-line.is-warn {
  color: var(--amber);
}

.upload-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.upload-check-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.upload-check-item .check-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 950;
}

.upload-check-item b,
.upload-check-item small {
  display: block;
}

.upload-check-item b {
  font-size: 13px;
}

.upload-check-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.upload-check-item > strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.upload-check-item.is-done {
  border-color: rgba(22, 131, 95, 0.28);
  background: rgba(235, 249, 244, 0.74);
}

.upload-check-item.is-done .check-mark {
  background: var(--green);
  color: white;
}

.upload-check-item.is-done > strong {
  color: var(--green);
}

.upload-check-item.is-optional {
  border-color: rgba(31, 126, 208, 0.16);
  background: rgba(232, 244, 255, 0.58);
}

.upload-check-item.is-optional .check-mark {
  background: rgba(31, 126, 208, 0.12);
  color: var(--primary-dark);
}

.upload-check-item.is-optional > strong {
  color: var(--primary-dark);
}

.upload-check-item.is-missing,
.upload-check-item.is-duplicate,
.upload-check-item.is-period-bad {
  border-color: rgba(186, 81, 76, 0.24);
  background: rgba(255, 244, 243, 0.74);
}

.upload-check-item.is-missing .check-mark,
.upload-check-item.is-duplicate .check-mark,
.upload-check-item.is-period-bad .check-mark {
  background: var(--rose);
  color: white;
}

.upload-check-item.is-missing > strong,
.upload-check-item.is-duplicate > strong,
.upload-check-item.is-period-bad > strong {
  color: var(--rose);
}

.duplicate-box {
  padding: 10px 12px;
  border: 1px solid rgba(186, 81, 76, 0.22);
  border-radius: 16px;
  background: rgba(255, 244, 243, 0.86);
  color: #9f3430;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.55;
}

.commit-box {
  display: grid;
  gap: 10px;
}

.commit-actions {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 9px;
}

.commit-btn {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
}

.commit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.25);
  box-shadow: none;
}

.commit-progress {
  padding: 12px;
  border: 1px solid rgba(217, 226, 231, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 126, 208, 0.1);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue), var(--amber));
  background-size: 180% 100%;
  transition: width 0.45s ease;
  animation: progress-glow 1.25s linear infinite;
}

@keyframes progress-glow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 180% 0;
  }
}

.commit-result {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.commit-result.is-success {
  color: var(--green);
  font-weight: 900;
}

.commit-result.is-danger {
  color: var(--rose);
  font-weight: 900;
}

.upload-rule-note {
  padding: 12px 13px;
  border: 1px solid rgba(217, 226, 231, 0.76);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.upload-rule-note b,
.upload-rule-note span {
  display: block;
}

.upload-rule-note b {
  margin-bottom: 5px;
  font-size: 13px;
}

.upload-rule-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.warning-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e3b35e;
  border-radius: 18px;
  background: #fff8e6;
  color: #775000;
  line-height: 1.6;
}

.is-hidden {
  display: none !important;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.file-card {
  position: relative;
  padding: 13px 13px 13px 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.file-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 999px;
  background: var(--green);
}

.file-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  margin: 10px 0 14px;
  padding: 7px;
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.54)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px) saturate(1.22);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  --indicator-x: 7px;
  --indicator-w: 80px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  opacity: 1;
  width: var(--indicator-w);
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(31, 126, 208, 0.98), rgba(58, 160, 255, 0.92)),
    #1f7ed0;
  box-shadow: 0 14px 28px rgba(31, 126, 208, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateX(var(--indicator-x));
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.tabs.is-tool-panel::before {
  opacity: 0;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.46);
  color: #0f67b3;
}

.tab.is-active {
  color: white;
  background: transparent;
  transform: translateY(-1px);
}

.tab-panel {
  transform-origin: top center;
  animation: panel-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tab-panel.is-leaving {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  animation: panel-out 0.18s ease both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.overview-rank-grid {
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.76fr) minmax(320px, 1fr);
  align-items: stretch;
}

.lineage-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(245, 251, 255, 0.68)),
    rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px) saturate(1.16);
}

.lineage-head {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 96px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 126, 208, 0.12), rgba(42, 179, 230, 0.08));
}

.lineage-head span,
.lineage-step span,
.lineage-step small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.lineage-head h2 {
  margin-top: 5px;
  font-size: 18px;
}

.lineage-head > strong {
  justify-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.lineage-head > strong.is-ready {
  background: rgba(31, 126, 208, 0.12);
  color: var(--primary-dark);
}

.lineage-head > strong.is-missing {
  background: rgba(186, 81, 76, 0.12);
  color: var(--rose);
}

.lineage-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.lineage-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(207, 229, 246, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.lineage-step i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: rgba(31, 126, 208, 0.12);
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 950;
}

.lineage-step strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.lineage-step small {
  display: block;
  line-height: 1.35;
}

.lineage-step.is-missing {
  border-color: rgba(186, 81, 76, 0.2);
  background: rgba(255, 244, 243, 0.66);
}

.lineage-step.is-missing i {
  background: rgba(186, 81, 76, 0.12);
  color: var(--rose);
}

.lineage-step.is-optional i {
  background: rgba(95, 120, 148, 0.12);
  color: var(--muted);
}

.overview-rank-grid .panel {
  height: 420px;
  min-height: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.overview-rank-grid .panel-head {
  margin-bottom: 8px;
}

.overview-rank-grid .panel h2 {
  font-size: 15px;
}

.overview-rank-grid .bar-list,
.overview-rank-grid .report-stack {
  min-height: 0;
}

.panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.56)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(20px) saturate(1.18);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panel.wide {
  grid-column: span 1;
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.overtime-toolbar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 150px auto auto;
  align-items: end;
  gap: 10px;
  margin: -2px 0 12px;
  padding: 12px;
  border: 1px solid rgba(207, 229, 246, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 251, 255, 0.66)),
    rgba(255, 255, 255, 0.7);
}

.overtime-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.overtime-toolbar input,
.overtime-toolbar select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(207, 229, 246, 0.95);
  border-radius: 13px;
  padding: 0 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 850;
}

.overtime-toolbar input:focus,
.overtime-toolbar select:focus {
  border-color: rgba(31, 126, 208, 0.58);
  box-shadow: 0 0 0 3px rgba(31, 126, 208, 0.12);
}

.overtime-filter-count {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.panel h2 {
  font-size: 16px;
  font-weight: 950;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e4f3f0;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 128px;
}

.profile-tag.is-good {
  border: 1px solid rgba(22, 131, 95, 0.18);
  background: rgba(22, 131, 95, 0.12);
  color: #126647;
}

.profile-tag.is-bad {
  border: 1px solid rgba(186, 81, 76, 0.2);
  background: rgba(186, 81, 76, 0.12);
  color: #a33a35;
}

.bar-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8eef1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.bar-value {
  color: var(--muted);
  text-align: right;
}

.absence-rank {
  gap: 6px;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 126, 208, 0.42) rgba(232, 244, 255, 0.5);
}

.absence-rank::-webkit-scrollbar {
  width: 7px;
}

.absence-rank::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(232, 244, 255, 0.5);
}

.absence-rank::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(31, 126, 208, 0.58), rgba(58, 160, 255, 0.46));
}

.absence-rank .bar-row {
  grid-template-columns: minmax(0, 1fr) minmax(90px, 98px);
  min-height: 34px;
  column-gap: 14px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.absence-rank .bar-main {
  display: grid;
  grid-template-columns: minmax(64px, 100px) minmax(36px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.absence-rank .bar-name {
  font-weight: 850;
}

.absence-rank .bar-track {
  height: 4px;
  background: rgba(232, 238, 241, 0.82);
}

.absence-rank .bar-fill {
  background: linear-gradient(90deg, var(--rose), var(--amber));
}

.overtime-rank {
  scrollbar-color: rgba(31, 126, 208, 0.42) rgba(232, 244, 255, 0.5);
}

.overtime-rank::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(22, 143, 143, 0.52), rgba(43, 143, 210, 0.46));
}

.overtime-rank .bar-fill {
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.overtime-period {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.overtime-period strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.overtime-period small,
.overtime-period em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(31, 126, 208, 0.18);
  border-radius: 999px;
  background: rgba(31, 126, 208, 0.1);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.evidence-pill.is-inferred {
  border-color: rgba(189, 122, 42, 0.2);
  background: rgba(189, 122, 42, 0.12);
  color: #9b641e;
}

.evidence-pill.is-review {
  border-color: rgba(186, 81, 76, 0.2);
  background: rgba(186, 81, 76, 0.12);
  color: var(--rose);
}

.my-duty-list {
  display: grid;
  gap: 12px;
}

.my-task-section {
  display: grid;
  gap: 10px;
}

.my-task-section + .my-task-section {
  margin-top: 4px;
}

.my-task-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.my-task-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.my-task-section-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.my-task-section-head span,
.my-task-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.my-task-empty {
  padding: 14px;
  border: 1px dashed rgba(207, 229, 246, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  text-align: center;
}

.my-duty-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(207, 229, 246, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(246, 251, 255, 0.68)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
}

.my-duty-card-community .my-duty-date {
  background: rgba(220, 246, 239, 0.9);
  color: #0c7b69;
}

.my-duty-date {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  min-height: 94px;
  border-radius: 18px;
  background: rgba(226, 244, 255, 0.86);
  color: var(--primary-dark);
}

.my-duty-date strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.my-duty-date span,
.my-duty-main p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.my-duty-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.my-duty-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.my-duty-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.task-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(226, 242, 255, 0.82);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.task-type-badge.is-community {
  background: rgba(218, 244, 236, 0.86);
  color: #0c7b69;
}

.my-duty-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.my-duty-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.duty-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(31, 126, 208, 0.1);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.duty-status.is-good {
  background: rgba(22, 143, 143, 0.12);
  color: var(--green);
}

.duty-status.is-warn {
  background: rgba(189, 122, 42, 0.12);
  color: var(--amber);
}

.duty-status.is-bad {
  background: rgba(186, 81, 76, 0.12);
  color: var(--rose);
}

.absence-rank .bar-value {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.absence-rank .bar-value strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.absence-rank .bar-value small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.report-stack {
  display: grid;
  gap: 10px;
}

.overview-rank-grid .report-stack {
  max-height: none;
  align-content: start;
  gap: 8px;
  overflow: visible;
  padding-right: 0;
}

.report-item {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 248, 0.58)),
    var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.report-item strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.report-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  position: relative;
  z-index: 1;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.table-pagination {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-actions strong {
  min-width: 58px;
  color: var(--ink);
  text-align: center;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pagination-page {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pagination-page:hover {
  border-color: rgba(31, 126, 208, 0.34);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.pagination-page.is-active {
  border-color: #1f7ed0;
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
  background: white;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8edf0;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f6;
  color: #42526b;
  font-weight: 950;
}

tbody tr:hover {
  background: #f7fbfa;
}

.clickable-row,
.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: rgba(24, 138, 164, 0.44);
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.12);
  transform: translateY(-1px);
}

.person-link {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  text-align: left;
  cursor: pointer;
}

.person-link span {
  font-weight: 950;
}

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

.person-link:hover span {
  text-decoration: underline;
}

.preference-cell {
  min-width: 230px;
  color: #344054;
  font-size: 12px;
  line-height: 1.55;
}

.preference-cell div + div {
  margin-top: 3px;
}

.preference-cell b {
  display: inline-block;
  min-width: 34px;
  margin-right: 6px;
  color: #667085;
}

.report-days-cell {
  min-width: 126px;
}

.report-days-cell span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 4px 4px 0;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef4f5;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.empty,
.empty-cell {
  color: var(--muted);
  text-align: center;
}

.profile-list {
  display: grid;
  gap: 10px;
  max-height: 590px;
  overflow: auto;
  padding-right: 2px;
}

.profile-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(246, 251, 250, 0.66)),
    rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.profile-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.profile-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.device-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.device-chip {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4f5;
  color: #344054;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portrait-overlay-open {
  overflow: hidden;
}

body.import-preview-open,
body.data-settings-open {
  overflow: hidden;
}

.import-preview-drawer,
.data-settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.import-preview-drawer.is-open,
.data-settings-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.import-preview-backdrop,
.data-settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 32, 42, 0.34);
  backdrop-filter: blur(12px) saturate(1.12);
  cursor: pointer;
}

.import-preview-panel,
.data-settings-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  width: min(760px, calc(100vw - 36px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 248, 247, 0.7)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 34px 96px rgba(18, 32, 42, 0.28), 0 1px 0 rgba(255, 255, 255, 0.86) inset;
  transform: translateX(26px);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.import-preview-drawer.is-open .import-preview-panel,
.data-settings-drawer.is-open .data-settings-panel {
  transform: translateX(0);
}

.import-preview-head,
.data-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(217, 226, 231, 0.82);
}

.import-preview-head h2,
.data-settings-head h2 {
  margin-top: 3px;
  font-size: 20px;
}

.import-preview-head p,
.data-settings-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.drawer-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #53647a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.import-preview-panel .preview-list,
.data-settings-panel .preview-list {
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.data-settings-body {
  display: grid;
  min-height: 0;
  align-content: start;
  grid-auto-rows: auto;
  gap: 14px;
  overflow: auto;
  padding-right: 3px;
}

.data-settings-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  justify-self: center;
  align-items: center;
  width: min(720px, 100%);
  height: 46px;
  margin-inline: auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 15px;
  background: rgba(245, 251, 252, 0.9);
  backdrop-filter: blur(16px);
}

.data-settings-tabs button {
  min-width: 0;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.data-settings-tabs button.is-active {
  background: linear-gradient(135deg, #1f7ed0, #3aa0ff);
  color: white;
  box-shadow: 0 10px 22px rgba(31, 126, 208, 0.2);
}

.data-settings-section {
  display: grid;
  gap: 14px;
}

.data-settings-body .upload-panel {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.data-settings-body .drop-zone {
  min-height: 150px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  padding: 18px;
  border-radius: 20px;
}

.data-settings-body .drop-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 28px;
}

.data-settings-body .drop-zone strong {
  font-size: 18px;
}

.data-settings-body .upload-audit {
  padding: 14px;
  border-radius: 20px;
}

.data-settings-body .file-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.data-settings-body .warning-box {
  margin-bottom: 0;
}

.settings-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

.settings-card h3 {
  margin: 0;
  font-size: 16px;
}

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

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.redundant-data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.redundant-data-summary span {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(212, 231, 237, 0.88);
  border-radius: 16px;
  background: rgba(245, 251, 252, 0.82);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.redundant-data-summary b {
  color: var(--primary-dark);
  font-size: 18px;
}

.cleanup-result {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.cleanup-result.is-success {
  color: var(--green);
}

.cleanup-result.is-danger {
  color: var(--rose);
}

.database-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.database-health-grid article,
.archive-kind-list article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(212, 231, 237, 0.88);
  border-radius: 16px;
  background: rgba(245, 251, 252, 0.82);
}

.database-health-grid span,
.archive-kind-list span,
.database-health-grid em,
.archive-kind-list em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.database-health-grid strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 950;
}

.archive-kind-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.archive-kind-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}

.maintenance-actions,
.archive-row-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-row-filters {
  display: grid;
  grid-template-columns: 150px 150px minmax(180px, 1fr) auto;
}

.archive-row-filters input,
.archive-row-filters select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(207, 229, 246, 0.95);
  border-radius: 13px;
  padding: 0 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 850;
}

.archive-row-table-wrap {
  overflow: auto;
  border: 1px solid rgba(217, 226, 231, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.archive-row-table {
  min-width: 760px;
}

.archive-row-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.archive-row-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(31, 126, 208, 0.18);
  border-radius: 18px;
  background: rgba(232, 244, 255, 0.68);
}

.archive-row-editor textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid rgba(207, 229, 246, 0.95);
  border-radius: 14px;
  padding: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.inline-portrait {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 30px 38px;
  background:
    radial-gradient(circle at 70% 12%, rgba(255, 255, 255, 0.34), transparent 30%),
    radial-gradient(circle at 18% 82%, rgba(123, 216, 232, 0.2), transparent 30%),
    rgba(18, 32, 42, 0.38);
  backdrop-filter: blur(16px) saturate(1.16);
  animation: portrait-overlay-in 0.22s ease both;
}

@keyframes portrait-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.portrait-page-card {
  position: relative;
  overflow: auto;
  width: min(1160px, 100%);
  max-height: calc(100vh - 60px);
  min-height: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 247, 0.56)),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 34px 92px rgba(18, 32, 42, 0.28), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(24px) saturate(1.25);
  animation: portrait-card-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(24, 138, 164, 0.44) transparent;
}

.portrait-page-card::-webkit-scrollbar {
  width: 8px;
}

.portrait-page-card::-webkit-scrollbar-track {
  background: transparent;
}

.portrait-page-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(24, 138, 164, 0.62), rgba(43, 143, 210, 0.46));
}

@keyframes portrait-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portrait-card-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  min-height: 270px;
  padding: 24px;
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(31, 126, 208, 0.96), rgba(42, 179, 230, 0.88) 56%, rgba(58, 160, 255, 0.84));
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 42px rgba(31, 126, 208, 0.2);
}

.portrait-card-hero::after {
  content: "";
  position: absolute;
  right: -62px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
  pointer-events: none;
}

.portrait-back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 950;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.portrait-back:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.portrait-identity {
  position: relative;
  z-index: 1;
  align-self: end;
  padding-top: 72px;
}

.portrait-identity > span,
.portrait-score span,
.portrait-score em {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.portrait-identity h2 {
  margin: 10px 0 10px;
  font-size: clamp(48px, 6vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

.portrait-identity p {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
}

.portrait-identity .profile-tag.is-good {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(22, 163, 74, 0.2);
  color: #dcfce7;
}

.portrait-identity .profile-tag.is-bad {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(185, 28, 28, 0.24);
  color: #fee2e2;
}

.portrait-score {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.portrait-score strong {
  display: block;
  margin: 18px 0 9px;
  font-size: 58px;
  line-height: 0.95;
}

.portrait-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.portrait-metric-grid article,
.portrait-section {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 249, 0.68)),
    rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(1.12);
}

.portrait-metric-grid article {
  min-height: 148px;
  padding: 18px;
}

.portrait-metric-grid span,
.portrait-metric-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.portrait-metric-grid strong {
  display: block;
  margin: 17px 0 5px;
  font-size: 36px;
  line-height: 0.95;
  font-weight: 950;
}

.portrait-metric-grid article:nth-child(1) strong {
  color: var(--blue);
}

.portrait-metric-grid article:nth-child(2) strong {
  color: var(--amber);
}

.portrait-metric-grid article:nth-child(3) strong {
  color: var(--rose);
}

.portrait-metric-grid article:nth-child(4) strong {
  color: var(--primary);
}

.portrait-metric-grid article:nth-child(5) strong {
  color: var(--green);
}

.portrait-metric-grid article:nth-child(6) strong {
  color: var(--blue);
}

.portrait-metric-grid article:nth-child(7) strong {
  color: var(--amber);
}

.portrait-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.portrait-section {
  min-height: 220px;
  padding: 18px;
}

.portrait-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portrait-section-head span,
.portrait-section small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.portrait-section-head strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.portrait-section p {
  margin: 18px 0 10px;
  color: #314052;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.45;
}

.portrait-progress {
  height: 12px;
  margin: 18px 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 126, 208, 0.1);
}

.portrait-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.portrait-device-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.portrait-device-list div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(217, 226, 231, 0.72);
}

.portrait-device-list span {
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portrait-device-list b {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.portrait-device-list i {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--amber));
}

.clock-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 12px;
}

.clock-profile-item {
  min-height: 132px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 231, 0.72);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.56);
}

.clock-profile-item span,
.clock-profile-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.clock-profile-item strong {
  display: block;
  margin: 10px 0 7px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.clock-profile-item p {
  margin: 0 0 9px;
  color: #263746;
  font-size: 13px;
}

.clock-profile-item.is-good strong {
  color: var(--green);
}

.clock-profile-item.is-bad strong {
  color: var(--rose);
}

.portrait-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 950;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mini-stat-grid article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.mini-stat-grid span,
.mini-stat-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.mini-stat-grid strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.personal-mobile-home {
  display: none;
}

.role-user .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.role-user .sidebar {
  display: none;
}

.role-user .main {
  width: min(100%, 960px);
  margin: 0 auto;
}

.role-user .personal-mobile-home {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.role-user #tab-overview .lineage-panel,
.role-user #tab-overview .overview-rank-grid,
.role-user #tab-overview .people-overview-panel {
  display: none;
}

.personal-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 168px;
  padding: 22px;
  border-radius: 28px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 52, 82, 0.98), rgba(31, 126, 208, 0.92) 58%, rgba(22, 143, 143, 0.88)),
    #173452;
  box-shadow: 0 22px 52px rgba(23, 75, 125, 0.18);
}

.personal-hero span,
.personal-hero p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.personal-hero h2 {
  margin-top: 12px;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 950;
}

.personal-hero p {
  margin-top: 8px;
}

.personal-hero > strong {
  flex: 0 0 auto;
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
}

.personal-status-card,
.personal-shortcuts button,
.overtime-mobile-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 255, 0.72)),
    rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.personal-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
}

.personal-status-card span,
.personal-shortcuts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.personal-status-card strong,
.personal-shortcuts strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 950;
}

.personal-status-card button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 15px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: #ffffff;
  font-weight: 950;
  cursor: pointer;
}

.personal-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.personal-metric-grid article {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(207, 229, 246, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.personal-metric-grid span,
.personal-metric-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.personal-metric-grid strong {
  display: inline-block;
  margin: 9px 4px 0 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  font-weight: 950;
}

.personal-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.personal-shortcuts button {
  min-height: 82px;
  border-radius: 20px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.overtime-mobile-list {
  display: none;
}

.overtime-mobile-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
}

.overtime-mobile-head,
.overtime-mobile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overtime-mobile-head strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.overtime-mobile-head span,
.overtime-mobile-line span,
.overtime-mobile-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.overtime-mobile-head em {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 126, 208, 0.12);
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.overtime-mobile-line strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.ticket-toolbar,
.ai-search-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.ticket-toolbar input,
.ticket-toolbar select,
.ai-search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: 16px;
  padding: 0 13px;
  outline: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 850;
}

.ai-search-box {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ai-model-summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(95, 120, 148, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.ai-model-summary.is-good {
  background: rgba(22, 143, 143, 0.12);
  color: var(--green);
}

.ai-model-summary.is-warn {
  background: rgba(189, 122, 42, 0.13);
  color: var(--amber);
}

.ai-config-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 15px;
  border: 1px solid rgba(31, 126, 208, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(232, 244, 255, 0.68), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ai-config-panel.is-hidden {
  display: none;
}

.ai-config-head,
.ai-config-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-config-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.ai-config-head span,
.ai-config-actions small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-config-head a {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.ai-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ai-config-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.ai-config-grid input,
.ai-config-grid select,
.ai-config-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(217, 226, 231, 0.92);
  border-radius: 14px;
  padding: 0 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 850;
}

.ai-config-grid textarea {
  min-height: 78px;
  padding: 10px 11px;
  resize: vertical;
}

.ai-config-toggle {
  grid-column: span 2;
  min-height: 40px;
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  padding: 0 12px;
  border: 1px solid rgba(217, 226, 231, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink) !important;
}

.ai-config-toggle input {
  width: 18px;
  min-height: 18px;
}

.ai-config-wide {
  grid-column: 1 / -1;
}

.ai-config-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-config-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ai-config-message.is-good {
  color: var(--green);
}

.ai-config-message.is-bad {
  color: var(--rose);
}

.ticket-list,
.ai-hits,
.report-center-list {
  display: grid;
  gap: 12px;
}

.ticket-card,
.ai-hit,
.report-card {
  padding: 15px;
  border: 1px solid rgba(217, 226, 231, 0.88);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(1.15);
}

.ticket-card.is-high {
  border-color: rgba(186, 81, 76, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 245, 244, 0.7)),
    rgba(255, 255, 255, 0.66);
}

.ticket-head,
.ticket-actions,
.report-card > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ticket-head strong,
.ai-hit strong,
.report-card strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.ticket-head span,
.ticket-actions small,
.ai-hit span,
.report-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ticket-card p,
.ai-hit p {
  margin: 12px 0;
  color: #263746;
  font-size: 13px;
  line-height: 1.65;
}

.ticket-status {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 126, 208, 0.1);
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.ticket-status.is-resolved {
  color: var(--green);
  background: rgba(22, 143, 143, 0.12);
}

.ticket-status.is-ignored {
  color: var(--muted);
  background: rgba(95, 120, 148, 0.12);
}

.ticket-status.is-in_progress {
  color: var(--amber);
  background: rgba(189, 122, 42, 0.13);
}

.ticket-actions > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.rule-trace-box {
  display: grid;
  gap: 14px;
}

.trace-grid,
.trace-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trace-grid article,
.trace-steps article {
  min-height: 96px;
  padding: 15px;
  border: 1px solid rgba(217, 226, 231, 0.88);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
}

.trace-grid span,
.trace-steps span,
.trace-grid small,
.trace-steps small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.trace-grid strong,
.trace-steps strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

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

.formula-list p,
.ai-answer {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: #263746;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 800;
}

.ai-answer {
  margin-bottom: 12px;
}

.report-card {
  display: grid;
  gap: 12px;
}

.report-card pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #263746;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
}

#tab-schedule:not(.is-hidden) {
  display: grid;
  gap: 16px;
}

#tab-schedule .mini-stat-grid,
#tab-schedule .content-grid {
  margin-bottom: 0;
}

.schedule-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  align-items: start;
}

.community-layout {
  grid-template-columns: minmax(380px, 0.88fr) minmax(0, 1.12fr);
  align-items: start;
}

.schedule-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.btn.compact {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 12px;
}

.schedule-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.schedule-list-more {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(207, 229, 246, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 252, 255, 0.8)),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 -10px 24px rgba(23, 75, 125, 0.08);
}

.schedule-list-more span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.duty-bulk-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid rgba(207, 229, 246, 0.92);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(245, 251, 255, 0.66)),
    rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.duty-bulk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}

.duty-bulk-head strong {
  font-size: 14px;
  font-weight: 950;
}

.duty-bulk-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.duty-bulk-head span.is-error {
  color: var(--rose);
}

#community-import-status.is-error {
  color: var(--rose);
}

.schedule-docx-input {
  display: none;
}

.duty-bulk-panel textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid rgba(217, 226, 231, 0.94);
  border-radius: 16px;
  padding: 12px;
  overflow: auto;
  outline: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
  line-height: 1.75;
  tab-size: 14;
  white-space: pre;
  word-break: normal;
}

.duty-bulk-panel textarea::placeholder {
  color: rgba(46, 61, 76, 0.58);
  opacity: 1;
}

.duty-bulk-panel textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.duty-bulk-panel textarea::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(226, 239, 248, 0.82);
}

.duty-bulk-panel textarea::-webkit-scrollbar-thumb {
  border: 2px solid rgba(226, 239, 248, 0.82);
  border-radius: 999px;
  background: rgba(31, 126, 208, 0.42);
}

.duty-bulk-panel textarea:focus {
  border-color: rgba(31, 126, 208, 0.48);
  box-shadow: 0 0 0 4px rgba(31, 126, 208, 0.1);
}

.duty-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.schedule-card {
  padding: 14px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(246, 251, 250, 0.66)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
}

.schedule-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-card-head input {
  min-height: 38px;
  border: 1px solid rgba(217, 226, 231, 0.9);
  border-radius: 14px;
  padding: 0 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 950;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 18px;
  font-weight: 950;
}

.icon-btn.danger {
  color: var(--rose);
  border-color: rgba(186, 81, 76, 0.22);
}

.schedule-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.schedule-form-grid.one-col {
  grid-template-columns: 1fr;
}

.schedule-wide-field {
  grid-column: 1 / -1;
}

.schedule-form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.schedule-form-grid input,
.schedule-form-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(217, 226, 231, 0.9);
  border-radius: 13px;
  padding: 0 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 850;
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.schedule-actions p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.community-audit-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.community-audit-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(246, 251, 255, 0.68)),
    rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft);
}

.community-audit-date {
  display: grid;
  place-items: center;
  min-height: 66px;
  border-radius: 18px;
  background: rgba(226, 242, 255, 0.72);
  color: var(--primary-dark);
  font-weight: 950;
}

.community-audit-date strong {
  font-size: 20px;
  line-height: 1;
}

.community-audit-date span,
.community-audit-main p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.community-audit-main {
  min-width: 0;
}

.community-audit-main h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.community-audit-main p {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.community-status.is-good {
  background: rgba(35, 155, 126, 0.13);
  color: #117d68;
}

.community-status.is-warn {
  background: rgba(206, 139, 34, 0.14);
  color: #9a6716;
}

.community-status.is-bad {
  background: rgba(186, 81, 76, 0.13);
  color: var(--rose);
}

.community-status.is-neutral {
  background: rgba(100, 117, 137, 0.12);
  color: var(--muted);
}

.preview-list {
  display: grid;
  gap: 12px;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.preview-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f3f6f6;
  font-weight: 900;
}

.preview-scroll {
  overflow: auto;
  max-height: 260px;
}

.account-layout {
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-form-wide {
  grid-column: 1 / -1;
}

.account-table-wrap table {
  min-width: 1340px;
}

.account-table td {
  vertical-align: middle;
}

.account-table input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.sms-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(24, 138, 164, 0.17), rgba(43, 143, 210, 0.11)),
    rgba(255, 255, 255, 0.68);
}

.sms-hero p {
  margin-top: 8px;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.65;
}

.sms-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sms-status-card {
  min-height: 106px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.56)),
    rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.2);
}

.sms-status-card span,
.sms-status-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.sms-status-card strong {
  display: block;
  margin: 12px 0 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-status-card .is-good,
.sms-state.is-sent {
  color: var(--green);
}

.sms-status-card .is-bad,
.sms-state.is-failed {
  color: var(--rose);
}

.sms-status-card .is-warn,
.sms-state.is-dry_run {
  color: var(--amber);
}

.sms-layout {
  grid-template-columns: minmax(330px, 0.52fr) minmax(0, 1fr);
}

.sms-contacts-panel {
  margin-bottom: 14px;
}

.sms-contact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-upload-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

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

.file-picker-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(31, 126, 208, 0.24);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    rgba(232, 244, 255, 0.72);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  cursor: pointer;
  white-space: nowrap;
}

.file-picker-control:hover {
  border-color: rgba(31, 126, 208, 0.42);
  background: rgba(255, 255, 255, 0.86);
}

.file-picker-name {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-hero p {
  max-width: 860px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.source-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1fr);
  gap: 14px;
}

.source-card {
  align-content: start;
}

.source-status {
  display: grid;
  gap: 12px;
}

.source-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.source-status-head strong {
  font-size: 18px;
}

.pill.is-good {
  color: var(--green);
  background: rgba(22, 143, 143, 0.12);
}

.pill.is-warn {
  color: var(--amber);
  background: rgba(189, 122, 42, 0.13);
}

.source-status-grid {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid rgba(217, 226, 231, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
}

.source-status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.source-status-grid b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-warning,
.source-message {
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255, 248, 230, 0.9);
  color: #8a5a17;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.55;
}

.source-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-doc-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(31, 126, 208, 0.18);
  border-radius: 11px;
  background: rgba(232, 244, 255, 0.62);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.source-config {
  margin-top: 14px;
}

.source-config-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-config-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.source-config-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.source-config-form input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(217, 226, 231, 0.9);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  outline: none;
}

.source-config-form input:focus {
  border-color: rgba(55, 170, 160, 0.55);
  box-shadow: 0 0 0 4px rgba(123, 216, 232, 0.16);
}

.source-config-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-config-wide {
  grid-column: 1 / -1;
}

.source-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.source-config-actions .btn,
.source-actions .btn {
  min-height: 38px;
  border-radius: 13px;
  padding: 0 13px;
  font-size: 12px;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.source-runs {
  display: grid;
  gap: 10px;
}

.source-run {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(217, 226, 231, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.source-run.is-failed {
  border-color: rgba(186, 81, 76, 0.24);
  background: rgba(255, 244, 243, 0.72);
}

.source-run > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.source-run strong {
  color: var(--ink);
}

.source-run span,
.source-run small,
.source-run p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-run p {
  margin: 0;
  color: #53647a;
  font-weight: 850;
}

.sms-contact-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}

.sms-contact-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sms-contact-tools input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(217, 226, 231, 0.95);
  border-radius: 16px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sms-contact-tools input:focus {
  border-color: rgba(55, 170, 160, 0.55);
  box-shadow: 0 0 0 4px rgba(123, 216, 232, 0.16);
}

.sms-contact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.sms-contact-summary article {
  min-height: 88px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 231, 0.82);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
}

.sms-contact-summary span,
.sms-contact-summary em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.sms-contact-summary strong {
  display: block;
  margin: 8px 0 3px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.sms-contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 216, 232, 0.6) rgba(255, 255, 255, 0.1);
}

.sms-contact-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 12px;
  border: 1px solid rgba(217, 226, 231, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.sms-contact-list article:hover,
.sms-contact-list article.is-selected {
  border-color: rgba(55, 170, 160, 0.55);
  background: rgba(241, 252, 250, 0.82);
  box-shadow: 0 16px 34px rgba(38, 123, 116, 0.12);
  transform: translateY(-1px);
}

.sms-contact-list strong,
.sms-contact-list span,
.sms-contact-list code,
.sms-contact-list em,
.sms-contact-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-contact-list strong {
  color: var(--ink);
  font-size: 14px;
}

.sms-contact-list span,
.sms-contact-list small,
.sms-contact-list code,
.sms-contact-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.contact-pick {
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 52px;
  border: 1px solid rgba(55, 170, 160, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.sms-contact-list article.is-selected .contact-pick {
  background: linear-gradient(135deg, rgba(55, 170, 160, 0.98), rgba(80, 145, 210, 0.92));
  color: white;
  border-color: transparent;
}

.sms-selected-contacts {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(123, 216, 232, 0.36);
  border-radius: 18px;
  background: rgba(242, 252, 250, 0.72);
}

.sms-selected-contacts.empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.selected-contact-head,
.selected-contact-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-contact-head {
  justify-content: space-between;
}

.selected-contact-head strong {
  color: var(--ink);
  font-size: 13px;
}

.selected-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid rgba(55, 170, 160, 0.32);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.selected-contact-chip em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.sms-form,
.sms-template-list {
  display: grid;
  gap: 12px;
}

.sms-form label,
.sms-template-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sms-form input,
.sms-form select,
.sms-form textarea,
.sms-template-card input,
.sms-template-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(217, 226, 231, 0.95);
  border-radius: 15px;
  padding: 0 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-weight: 850;
}

.sms-form textarea,
.sms-template-card textarea {
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
}

.sms-variable-hint {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sms-variable-hint.is-good {
  color: var(--green);
}

.sms-variable-hint.is-bad {
  color: var(--rose);
}

.sms-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sms-template-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 216, 232, 0.6) rgba(255, 255, 255, 0.1);
}

.sms-template-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 231, 0.86);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.64);
}

.sms-template-top,
.sms-template-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sms-template-top input {
  flex: 1;
}

.sms-switch {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 7px !important;
  min-width: 72px;
  padding: 0 9px;
  border: 1px solid rgba(217, 226, 231, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.sms-switch input {
  width: 16px;
  min-height: 16px;
}

.sms-template-bottom code {
  color: var(--muted);
  font-size: 12px;
}

.sms-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 950;
}

.sms-message-scroll table {
  min-width: 980px;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.64;
}

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 32, 42, 0.26);
  z-index: 10;
  backdrop-filter: blur(6px);
}

.loading > div {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
  font-weight: 950;
}

@media (max-width: 1180px) {
  .inline-portrait {
    padding: 24px;
  }

  .upload-panel,
  .content-grid,
  .lineage-panel {
    grid-template-columns: 1fr;
  }

  .file-grid,
  .mini-stat-grid,
  .lineage-steps,
  .portrait-metric-grid,
  .sms-status-grid,
  .trace-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portrait-card-hero,
  .portrait-detail-grid,
  .sms-layout,
  .ticket-toolbar,
  .ai-search-box,
  .ai-config-grid {
    grid-template-columns: 1fr;
  }

  .commit-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  body.role-user {
    background:
      linear-gradient(180deg, #eef7ff 0, #f7fbff 260px, #eef6fb 100%),
      #eef6fb;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 58vh;
    padding: 14px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar::before {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .role-user .main {
    width: 100%;
    padding: 12px 12px calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .sms-hero,
  .sms-template-top,
  .sms-template-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .sms-status-grid,
  .sms-form-grid,
  .sms-contact-summary,
  .sms-contact-list,
  .source-layout,
  .source-config-form,
  .source-config-row,
  .trace-grid,
  .trace-steps {
    grid-template-columns: 1fr;
  }

  .sms-contact-actions,
  .table-pagination,
  .inline-upload-form,
  .overtime-toolbar,
  .ai-config-head,
  .ai-config-actions,
  .ticket-actions,
  .ticket-head,
  .report-card > div {
    width: 100%;
    justify-content: stretch;
  }

  .table-pagination {
    display: grid;
  }

  .overtime-toolbar {
    grid-template-columns: 1fr;
  }

  .pagination-actions {
    justify-content: space-between;
  }

  .inline-upload-form {
    display: grid;
  }

  .tabs {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .role-user .tabs {
    position: fixed;
    inset: auto 12px max(10px, env(safe-area-inset-bottom, 0px)) 12px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 6px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px rgba(23, 75, 125, 0.18);
  }

  .role-user .tabs::before {
    display: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
  }

  .role-user .tab {
    min-height: 52px;
    padding: 0 2px;
    border-radius: 16px;
    color: #647c93;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }

  .role-user .tab.is-active {
    background: linear-gradient(135deg, var(--primary), var(--blue));
    color: #ffffff;
    transform: none;
    box-shadow: 0 10px 24px rgba(31, 126, 208, 0.24);
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .auth-card .brand-mark {
    width: 58px;
    height: 58px;
  }

  .topbar-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .side-section {
    margin-top: 12px;
  }

  .org-list {
    max-height: calc(100vh - 176px);
    margin-right: 0;
    padding-right: 3px;
  }

  .topbar {
    padding: 16px;
    border-radius: 20px;
  }

  .role-user .topbar {
    position: sticky;
    top: 0;
    margin: -12px -12px 12px;
    padding: 14px 12px 12px;
    border-width: 0 0 1px;
    border-radius: 0 0 24px 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.88)),
      rgba(255, 255, 255, 0.9);
  }

  h1 {
    font-size: 21px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.55;
  }

  .inline-portrait {
    inset: 0;
    align-items: start;
    overflow: auto;
    padding: 14px;
  }

  .topbar,
  .toolbar {
    display: grid;
    gap: 12px;
  }

  .role-user .topbar-brand {
    gap: 0;
    min-width: 0;
  }

  .role-user .topbar-logo {
    display: none;
  }

  .role-user .topbar h1 {
    font-size: 25px;
  }

  .role-user .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-tool {
    width: 100%;
    min-height: 48px;
    height: 48px;
  }

  .user-chip {
    width: 100%;
    height: 48px;
  }

  .role-user .user-chip {
    min-width: 0;
    justify-content: space-between;
  }

  .role-user .user-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mode-switch {
    width: 100%;
    height: 48px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-switch button {
    min-width: 0;
  }

  .period-picker {
    width: 100%;
    height: 58px;
    min-width: 0;
  }

  .role-user .period-picker {
    height: 50px;
  }

  .period-display {
    flex: 1 1 auto;
  }

  .period-calendar-btn {
    flex: 0 0 auto;
  }

  .role-user .period-calendar-btn {
    width: 50px;
    padding: 0;
    font-size: 0;
  }

  .role-user .period-picker.is-open {
    z-index: 260;
  }

  .role-user .period-popover {
    position: fixed;
    top: clamp(92px, 13svh, 132px);
    right: auto;
    bottom: auto;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 28px));
    height: calc(100vh - 206px - env(safe-area-inset-bottom, 0px));
    max-height: 650px;
    padding: 14px;
    transform: translateX(-50%);
    overflow: hidden;
    border-radius: 22px;
    z-index: 260;
  }

  .role-user .period-popover-head {
    flex: 0 0 auto;
    margin-bottom: 10px;
  }

  .role-user .period-popover-head span {
    line-height: 1.45;
  }

  .role-user .period-date-fields {
    flex: 0 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .role-user .period-date-fields label {
    min-height: 64px;
    padding: 9px 10px;
    gap: 4px;
  }

  .role-user .period-date-fields input {
    font-size: 13px;
    text-align: center;
  }

  .role-user .period-calendar {
    min-height: 0;
    flex: 1 1 auto;
    gap: 8px;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 1px;
    -webkit-overflow-scrolling: touch;
  }

  .role-user .period-calendar-head {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .role-user .period-calendar-grid {
    gap: 5px;
  }

  .role-user .period-weekday {
    height: 22px;
  }

  .role-user .period-day {
    height: clamp(29px, 7.6vw, 34px);
    border-radius: 11px;
  }

  .role-user .period-calendar-legend {
    justify-content: center;
    gap: 8px;
    padding: 1px 0 0;
  }

  .role-user .period-popover-actions {
    flex: 0 0 auto;
    justify-content: stretch;
    margin-top: 10px;
  }

  .role-user .period-popover-actions .btn {
    flex: 1 1 0;
  }

  .period-date-fields {
    grid-template-columns: 1fr;
  }

  .import-preview-panel,
  .data-settings-panel {
    inset: 10px;
    width: auto;
    padding: 14px;
    border-radius: 20px;
  }

  .data-settings-tabs {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-settings-body .drop-zone,
  .data-settings-body .file-grid {
    grid-template-columns: 1fr;
  }

  .redundant-data-summary {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
    text-align: center;
  }

  .drop-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border-radius: 18px;
    font-size: 28px;
  }

  .drop-zone strong {
    font-size: 18px;
  }

  .glass-panel,
  .panel {
    border-radius: 20px;
  }

  .panel {
    padding: 12px;
  }

  .role-user .panel {
    padding: 14px;
    border-radius: 20px;
  }

  .panel-head {
    display: grid;
    align-items: start;
  }

  .panel-head > * {
    min-width: 0;
  }

  .schedule-head-actions,
  .duty-bulk-actions,
  .duty-bulk-head {
    width: 100%;
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    text-align: left;
  }

  .duty-bulk-head span {
    text-align: left;
  }

  .inline-check {
    margin-right: 0;
  }

  .sms-contact-actions,
  .inline-upload-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .file-picker-control,
  .file-picker-name,
  .ai-model-summary {
    width: 100%;
    max-width: none;
  }

  .file-grid,
  .mini-stat-grid,
  .lineage-steps,
  .portrait-metric-grid,
  .clock-profile-grid,
  .trace-grid,
  .trace-steps {
    grid-template-columns: 1fr;
  }

  .role-user .mini-stat-grid,
  .role-user .personal-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .personal-hero {
    min-height: 154px;
    padding: 20px;
    border-radius: 24px;
  }

  .personal-hero h2 {
    font-size: 31px;
  }

  .personal-hero > strong {
    font-size: 28px;
  }

  .personal-status-card,
  .personal-shortcuts {
    grid-template-columns: 1fr;
  }

  .personal-status-card {
    align-items: stretch;
    display: grid;
  }

  .personal-status-card button {
    width: 100%;
  }

  .personal-shortcuts button {
    min-height: 76px;
  }

  .role-user #tab-overtime .table-wrap {
    display: none;
  }

  .role-user #tab-overtime .overtime-mobile-list {
    display: grid;
    gap: 10px;
  }

  .role-user #tab-overtime .overtime-toolbar {
    padding: 10px;
  }

  .role-user #tab-overtime .panel-actions .pill {
    display: none;
  }

  .my-duty-card,
  .my-duty-title {
    grid-template-columns: 1fr;
    display: grid;
  }

  .my-duty-title {
    align-items: start;
  }

  .tabs {
    overflow-x: auto;
    border-radius: 18px;
  }

  .tab {
    flex: 0 0 auto;
    padding: 0 13px;
  }

  .absence-rank {
    max-height: 100%;
  }

  .overview-rank-grid .report-stack {
    max-height: none;
  }

  table {
    min-width: 1080px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .portrait-page-card,
  .portrait-card-hero {
    padding: 16px;
    border-radius: 24px;
  }

  .portrait-back {
    position: static;
    width: max-content;
    margin-bottom: 20px;
  }

  .portrait-identity {
    padding-top: 0;
  }

  .portrait-identity h2 {
    font-size: clamp(38px, 16vw, 58px);
  }

  .schedule-form-grid,
  .schedule-actions,
  .sms-contact-tools,
  .ai-config-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .community-audit-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .community-audit-date {
    width: 118px;
  }

  .community-status {
    justify-self: start;
  }

  .ai-config-toggle {
    grid-column: auto;
  }
}

/* Hikiot mobile data/ui patch v47 */
.personal-empty-card{display:grid;gap:10px;padding:22px;border:1px solid rgba(207,229,246,.95);border-radius:24px;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(246,251,255,.84)),#fff;box-shadow:var(--shadow-soft)}.personal-empty-card span{color:var(--muted);font-size:12px;font-weight:900}.personal-empty-card h2{color:var(--ink);font-size:28px;line-height:1.15}.personal-empty-card p{color:var(--muted);font-size:14px;line-height:1.65}.personal-empty-card strong{overflow-wrap:anywhere;color:var(--primary-dark);font-size:13px;line-height:1.4}@media(max-width:760px){.role-user .main{width:100%;padding:12px 12px calc(136px + env(safe-area-inset-bottom,0px))}.role-user .topbar{position:sticky;top:0;display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;margin:-12px -12px 12px;min-height:0;padding:22px 28px 24px;border-width:0 0 1px;border-radius:0 0 28px 28px;background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,252,255,.88)),rgba(255,255,255,.9)}.role-user .topbar-brand{gap:0;min-width:0;width:100%}.role-user .topbar>.topbar-brand,.role-user .topbar>.toolbar{min-width:0;width:100%;flex:1 1 auto;justify-self:stretch}.role-user .topbar-logo{display:none}.role-user .topbar h1{font-size:25px;line-height:1.18}.role-user .toolbar{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:stretch;gap:12px;width:100%;justify-self:stretch}.role-user .user-chip{width:86px;height:58px;min-width:0;justify-content:stretch}.role-user .user-chip button{width:100%;height:58px;min-height:58px;border-radius:20px}.role-user .period-picker{width:100%;height:58px;min-width:0;border-radius:20px}.role-user .period-calendar-btn{width:78px;padding:0;font-size:0;border-radius:16px}.role-user .personal-mobile-home{gap:14px}.role-user .mini-stat-grid,.role-user .personal-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.personal-hero{min-height:148px;padding:20px;border-radius:24px}.personal-hero h2{font-size:30px}.personal-hero>strong{font-size:28px}.personal-empty-card{padding:20px}.personal-status-card,.personal-shortcuts{grid-template-columns:1fr}.personal-status-card{align-items:stretch;display:grid}.personal-status-card button{width:100%}.personal-shortcuts button{min-height:76px}.role-user .personal-metric-grid{gap:12px}.role-user .personal-metric-grid article{display:flex;min-height:112px;flex-direction:column;justify-content:center;border-radius:22px}.role-user .tabs{position:fixed;inset:auto 0 0 0;z-index:70;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px));border:1px solid rgba(207,229,246,.82);border-width:1px 0 0;border-radius:24px 24px 0 0;background:rgba(255,255,255,.96);box-shadow:0 -18px 44px rgba(23,75,125,.14);backdrop-filter:blur(18px) saturate(1.12)}.role-user .tab{min-height:52px;padding:0 2px;border-radius:16px;color:#647c93;font-size:12px;line-height:1.15;white-space:normal}}
/* End Hikiot mobile data/ui patch v47 */
