/* ── Family Artifact Components ── */

/* ── Artifact Header ── */
.artifact-header {
  padding: var(--space-md) 0 var(--space-sm);
  border-bottom: 2px solid var(--accent);
  margin-bottom: var(--space-lg);
}

.artifact-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
}

.cat-badge.apartment  { background: var(--accent-soft); color: var(--accent); }
.cat-badge.home       { background: var(--green-soft);  color: var(--green); }
.cat-badge.health     { background: var(--red-soft);    color: var(--red); }
.cat-badge.tax        { background: var(--warm-soft);   color: var(--warm); }
.cat-badge.inherit    { background: rgba(139,92,246,.08); color: #8B5CF6; }
.cat-badge.smarthome  { background: rgba(16,185,129,.08);  color: #059669; }
.cat-badge.dev        { background: rgba(59,130,246,.08);  color: #2563EB; }
.cat-badge.other      { background: rgba(107,114,128,.08); color: var(--text-muted); }

:root[data-theme="dark"] .cat-badge.inherit,
:root:not([data-theme="light"]) .cat-badge.inherit {
  background: rgba(167,139,250,.12);
  color: #A78BFA;
}
:root[data-theme="dark"] .cat-badge.smarthome,
:root:not([data-theme="light"]) .cat-badge.smarthome {
  background: rgba(52,211,153,.12);
  color: #34D399;
}
:root[data-theme="dark"] .cat-badge.dev,
:root:not([data-theme="light"]) .cat-badge.dev {
  background: rgba(96,165,250,.12);
  color: #60A5FA;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
}

.status-badge.consultation { background: var(--accent-soft); color: var(--accent); }
.status-badge.approval     { background: #FEF3C7; color: #92400E; }
.status-badge.selection    { background: var(--accent-soft); color: var(--accent); }
.status-badge.estimate     { background: var(--accent-soft); color: var(--accent); }
.status-badge.ordered      { background: var(--accent-soft); color: var(--accent); }
.status-badge.in_progress  { background: var(--green-soft);  color: var(--green); }
.status-badge.completed    { background: var(--green-soft);  color: var(--green); }
.status-badge.ongoing      { background: var(--warm-soft);   color: var(--warm); }
.status-badge.reference    { background: rgba(107,114,128,.08); color: var(--text-muted); }
.status-badge.review       { background: var(--accent-soft); color: var(--accent); }
.status-badge.task         { background: var(--accent-soft); color: var(--accent); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-badge.approval { background: rgba(251,191,36,.12); color: #FCD34D; }
}
:root[data-theme="dark"] .status-badge.approval { background: rgba(251,191,36,.12); color: #FCD34D; }

.artifact-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

.artifact-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.artifact-date {
  font-size: .65rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Approval Callout ── */
.callout-approval {
  background: #FFFBEB;
  border: 2px solid #F59E0B;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.callout-approval .callout-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 800;
  color: #92400E;
  margin-bottom: var(--space-sm);
}

.callout-approval .callout-body {
  font-size: .9rem;
  line-height: 1.8;
  color: #78350F;
}

.callout-approval .callout-body ul {
  list-style: disc;
  padding-left: 1.2em;
  margin-top: var(--space-xs);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .callout-approval {
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.4);
  }
  :root:not([data-theme="light"]) .callout-approval .callout-label { color: #FCD34D; }
  :root:not([data-theme="light"]) .callout-approval .callout-body { color: #FDE68A; }
}
:root[data-theme="dark"] .callout-approval {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.4);
}
:root[data-theme="dark"] .callout-approval .callout-label { color: #FCD34D; }
:root[data-theme="dark"] .callout-approval .callout-body { color: #FDE68A; }

/* ── Info Callout ── */
.callout-info {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.callout-info .callout-label {
  font-size: .82rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.callout-info .callout-body {
  font-size: .88rem;
  line-height: 1.8;
}

/* ── Workflow Progress ── */
.workflow {
  margin-bottom: var(--space-xl);
}

.workflow-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

.wf-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.wf-label {
  padding: .35rem .7rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
}

.wf-label.done {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

.wf-label.current {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wf-label.current.needs-approval {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wf-label.current.needs-approval {
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.5);
    color: #FCD34D;
    box-shadow: 0 0 0 3px rgba(245,158,11,.1);
  }
}
:root[data-theme="dark"] .wf-label.current.needs-approval {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.5);
  color: #FCD34D;
  box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}

.wf-arrow {
  color: var(--border);
  font-size: .7rem;
  padding: 0 .2rem;
  flex-shrink: 0;
}

/* ── Section ── */
.artifact-section {
  margin-bottom: var(--space-xl);
}

.section-heading {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── Property Info Card ── */
.prop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prop-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.prop-row:last-child { border-bottom: none; }

.prop-label {
  width: 120px;
  flex-shrink: 0;
  padding: .6rem .8rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
}

.prop-value {
  flex: 1;
  padding: .6rem .8rem;
  font-size: .85rem;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: .45rem;
  top: .5rem;
  bottom: .5rem;
  width: 2px;
  background: var(--border);
}

.tl-entry {
  position: relative;
  padding-bottom: var(--space-md);
}

.tl-entry:last-child { padding-bottom: 0; }

.tl-entry::before {
  content: '';
  position: absolute;
  left: -1.05rem;
  top: .45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.tl-date {
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .1rem;
}

.tl-text {
  font-size: .85rem;
  line-height: 1.7;
}

/* ── Next Steps ── */
.next-steps {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.next-steps h3 {
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.next-steps ul {
  list-style: none;
  padding: 0;
}

.next-steps li {
  padding: .3rem 0;
  font-size: .85rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.next-steps li::before {
  content: '→';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Family Listing ── */
.family-hero {
  padding: var(--space-md) 0 var(--space-sm);
}

.family-hero h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: .1rem;
}

.family-hero p {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Sidebar Layout ── */
.family-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 200px);
  margin-left: calc(var(--space-xl) * -1);
  margin-right: calc(3rem * -1);
}

.family-sidebar {
  width: 190px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: var(--space-lg) 0 var(--space-xl);
  position: sticky;
  top: 0;
  height: fit-content;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar-label {
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem var(--space-lg);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: all .12s;
  user-select: none;
}

.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item.active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }
.nav-item.empty { opacity: .4; }
.nav-item.empty:hover { opacity: .7; }

.nav-stripe {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.nav-stripe.all       { background: var(--text-muted); }
.nav-stripe.apartment  { background: var(--accent); }
.nav-stripe.home       { background: var(--green); }
.nav-stripe.health     { background: var(--red); }
.nav-stripe.tax        { background: var(--warm); }
.nav-stripe.inherit    { background: #8B5CF6; }
.nav-stripe.other      { background: var(--border); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-stripe.inherit { background: #A78BFA; }
}
:root[data-theme="dark"] .nav-stripe.inherit { background: #A78BFA; }

.nav-count {
  margin-left: auto;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.family-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-sm) var(--space-xl) var(--space-2xl);
}

.result-info {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
  font-size: .85rem;
}

.artifact-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.artifact-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.artifact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(74,111,165,.08);
}

.artifact-card .card-status {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.card-status.consultation { background: var(--accent); }
.card-status.approval     { background: #F59E0B; }
.card-status.in_progress  { background: var(--green); }
.card-status.completed    { background: var(--green); }
.card-status.ongoing      { background: var(--warm); }

.artifact-card .card-body { flex: 1; min-width: 0; }
.artifact-card .card-title { font-size: .88rem; font-weight: 700; }

.artifact-card .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .15rem;
  flex-wrap: wrap;
}

.artifact-card .card-arrow {
  color: var(--border);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color .15s;
}

.artifact-card:hover .card-arrow { color: var(--text-muted); }

.needs-attention-flag {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .6rem;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .needs-attention-flag {
    background: rgba(245,158,11,.12);
    color: #FCD34D;
  }
}
:root[data-theme="dark"] .needs-attention-flag {
  background: rgba(245,158,11,.12);
  color: #FCD34D;
}

/* ── Attachments ── */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.attachment-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(74,111,165,.08);
}

.att-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-icon.att-gdrive { background: rgba(66,133,244,.08); }
.att-icon.att-pdf { background: var(--red-soft); color: var(--red); }
.att-icon.att-link { background: var(--accent-soft); color: var(--accent); }

.att-name {
  font-size: .82rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.att-ext {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: .4;
  transition: opacity .15s;
}

.attachment-item:hover .att-ext { opacity: .8; }

/* ── Edit Mode ── */
.edit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .5rem;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.edit-form {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.edit-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.edit-group {
  margin-bottom: var(--space-md);
}

.edit-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.edit-input {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
  font-family: var(--font-sans);
}

.edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.edit-label-input {
  max-width: 140px;
  flex-shrink: 0;
  font-weight: 600;
}

.edit-textarea {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
  font-family: var(--font-sans);
  line-height: 1.6;
  resize: vertical;
}

.edit-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.edit-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  align-items: center;
}

.btn-row-delete {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-row-delete:hover { background: var(--danger, #d33); color: #fff; border-color: var(--danger, #d33); }

.btn-section-delete {
  position: absolute;
  top: var(--space-xs, .25rem);
  right: var(--space-xs, .25rem);
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .4;
}
.btn-section-delete:hover { opacity: 1; background: var(--danger, #d33); color: #fff; }

.edit-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.btn-save {
  padding: .35rem .8rem;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.btn-save:hover { background: var(--accent-hover); }

.btn-cancel {
  padding: .35rem .8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.wf-clickable {
  cursor: pointer;
  transition: all .15s;
}

.wf-clickable:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.tl-add-form {
  margin-bottom: var(--space-md);
}

@media (min-width: 1300px) {
  .family-layout { margin-right: calc(var(--space-xl) * -1); }
}

/* ── Sidebar Filter Scroll (desktop: transparent) ── */
.sidebar-filter-wrap { display: contents; }
.sidebar-arrow { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .artifact-title { font-size: 1rem; }
  .artifact-title-row { flex-wrap: wrap; }
  .artifact-date { margin-left: 0; }

  .workflow-steps { gap: 0; }
  .wf-label { padding: .25rem .5rem; font-size: .65rem; }

  .prop-row { flex-direction: column; }
  .prop-label { width: 100%; }

  .family-layout { flex-direction: column; margin: 0; }

  .family-sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: .5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
  }

  .sidebar-about-link {
    margin: 0 .75rem .4rem;
    padding: .45rem .7rem;
    font-size: .72rem;
    white-space: nowrap;
    justify-content: center;
    flex-shrink: 0;
  }
  .about-icon { width: 1.1rem; height: 1.1rem; font-size: .55rem; }
  .about-anchor { display: none; }

  .sidebar-filter-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-filter-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar-filter-scroll::-webkit-scrollbar { display: none; }

  .sidebar-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.6rem;
    height: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .6rem;
    cursor: pointer;
    padding: .4rem 0;
    transition: opacity .15s;
  }
  .sidebar-arrow:active { color: var(--accent); }

  .sidebar-label { display: none; }

  .nav-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .4rem .75rem;
    white-space: nowrap;
    font-size: .75rem;
  }

  .nav-item.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .nav-stripe { display: none; }

  .family-content { padding: var(--space-md) 0 var(--space-xl); }

  .edit-label-input { max-width: 100%; }
  .edit-row { flex-direction: column; }

  .item-tab {
    padding: .45rem .8rem;
    font-size: .78rem;
  }
}

/* ── Sidebar About Link ── */
.sidebar-about-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 var(--space-md) var(--space-md);
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
}
.sidebar-about-link:hover {
  background: var(--accent);
  color: #fff;
}
.sidebar-about-link.back {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}
.sidebar-about-link.back:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.about-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  flex-shrink: 0;
}
.sidebar-about-link:hover .about-icon {
  background: #fff;
  color: var(--accent);
}
.about-anchor {
  text-decoration: none;
  color: var(--text-muted);
}
.about-anchor:hover {
  color: var(--text);
}

/* ── About Page ── */
.about-page { max-width: 720px; }

.about-section { margin-bottom: var(--space-xl); }
.about-section h2 {
  font-size: 1.1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: var(--space-xs, .25rem);
  margin-bottom: var(--space-md);
}

.about-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.about-card h3 { font-size: .95rem; margin: 0 0 var(--space-sm); }
.about-card ul { margin: 0; padding-left: 1.2rem; }
.about-card li { font-size: .88rem; line-height: 1.6; margin-bottom: var(--space-xs, .25rem); }

.about-flow { display: flex; flex-direction: column; gap: var(--space-md); }
.flow-step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.flow-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.flow-body h3 { font-size: .92rem; margin: 0 0 .2rem; }
.flow-body p { font-size: .85rem; margin: 0; color: var(--text-muted); line-height: 1.5; }

/* ── Item Tabs ── */
.item-tabs {
  margin-top: var(--space-md);
}
.item-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.item-tabs-bar::-webkit-scrollbar {
  display: none;
}
.item-tab {
  padding: .6rem 1.2rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.item-tab:hover {
  color: var(--text);
}
.item-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.item-tab-panel {
  display: none;
}
.item-tab-panel.active {
  display: block;
}

/* ── Tab Table ── */
.tab-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.tab-table th {
  background: var(--accent-soft, rgba(74,111,165,.08));
  color: var(--accent);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .04em;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.tab-table td {
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.tab-table tbody tr:nth-child(even) td {
  background: var(--surface, rgba(0,0,0,.02));
}

/* ── Block Sidebar ── */
.block-sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 899;
  display: none;
}
.block-sidebar-overlay.open { display: block; }

.block-sidebar {
  position: fixed; top: 0; right: 0;
  width: 300px; height: 100vh;
  z-index: 900;
  background: var(--bg);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.block-sidebar.open { transform: translateX(0); }

.block-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.block-sidebar-title { font-weight: 700; font-size: .85rem; }
.block-sidebar-close {
  background: none; border: none; font-size: 1.2rem;
  color: var(--text-muted); cursor: pointer; padding: .2rem .4rem;
}
.block-sidebar-close:hover { color: var(--text); }

.block-sidebar-body {
  flex: 1; overflow-y: auto; padding: .6rem 0;
}

.block-group {
  padding: .4rem 1rem .8rem;
  border-bottom: 1px solid var(--border);
}
.block-group:last-child { border-bottom: none; }
.block-group-label {
  font-size: .72rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: .4rem;
}

.block-sidebar-hint {
  font-size: .72rem; color: var(--text-muted); padding: .2rem 0;
}

.block-sidebar-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem 0;
  font-size: .78rem;
}
.block-item-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.block-item-actions { display: flex; gap: .15rem; flex-shrink: 0; }
.block-item-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 1.5rem; height: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; color: var(--text-muted); cursor: pointer;
  transition: all .15s;
}
.block-item-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.block-item-btn.danger:hover { background: rgba(200,50,50,.08); color: #c33; border-color: #c33; }

.block-type-badge {
  font-size: .6rem; font-weight: 700;
  padding: .1rem .35rem; border-radius: 3px;
  flex-shrink: 0;
  background: var(--accent-soft, rgba(74,111,165,.08));
  color: var(--accent);
}
.block-type-badge.table {
  background: rgba(193,127,62,.1);
  color: var(--warm, #C17F3E);
}

.block-add-form {
  display: flex; gap: .3rem; align-items: center;
  margin-top: .5rem;
}
.block-add-select {
  font-size: .7rem; padding: .25rem .3rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.block-add-input {
  flex: 1; min-width: 0;
  font-size: .72rem; padding: .3rem .4rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.block-add-input::placeholder { color: var(--text-muted); }
.block-add-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm);
  width: 1.6rem; height: 1.6rem;
  font-size: .85rem; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.block-add-btn:hover { opacity: .85; }

.block-sidebar-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 200;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; box-shadow: 0 2px 8px rgba(0,0,0,.2);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.block-sidebar-toggle:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.25); }

@media (max-width: 768px) {
  .block-sidebar {
    width: 100%; top: auto; bottom: 0; right: 0;
    height: 70vh;
    border-left: none; border-top: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transform: translateY(100%);
  }
  .block-sidebar.open { transform: translateY(0); }
  .block-sidebar-toggle { bottom: 1rem; right: 1rem; width: 2.6rem; height: 2.6rem; font-size: 1rem; }
}

@media print {
  .edit-btn, .tl-add-form, .btn-row-delete, .btn-section-delete { display: none !important; }
  .family-layout, .family-sidebar { display: none !important; }
  .block-sidebar, .block-sidebar-overlay, .block-sidebar-toggle { display: none !important; }
  .callout-approval { break-inside: avoid; }
  .prop-card { break-inside: avoid; }
}
