﻿body { margin: 0; font: 14px "Segoe UI", sans-serif; color: #1c1c1c; background: #f4f5f6; }
header { background: #243044; padding: 10px 16px; }
header a { color: #fff; margin-right: 16px; text-decoration: none; }
main { padding: 12px 16px; }
.layout { display: flex; gap: 16px; align-items: flex-start; }
.list { width: 320px; background: #fff; border: 1px solid #d0d4d8; padding: 8px; }
.form { flex: 1; background: #fff; border: 1px solid #d0d4d8; padding: 12px; }
input[type=search], input[type=text], select, textarea { width: 100%; box-sizing: border-box; }
textarea { min-height: 72px; }
.row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; margin: 6px 0; align-items: center; }
.hit { display: block; padding: 4px 2px; color: #143; text-decoration: none; }
.hit.on { background: #e4eef8; }
.status { margin: 8px 0; }
.status.ok { color: #0a6; }
.status.bad { color: #a30; }
button { padding: 6px 14px; }
table { border-collapse: collapse; }
th, td { border: 1px solid #d0d4d8; padding: 4px; vertical-align: top; }
.tablewrap { overflow-x: auto; }
.levels a { margin-right: 8px; }
h1 { font-size: 18px; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 16px 0 8px; }
.tree { margin: 8px 0; max-height: 220px; overflow: auto; border-top: 1px solid #e4e7ea; border-bottom: 1px solid #e4e7ea; padding: 6px 0; }
.tree-title { margin: 0 0 4px; font-weight: 600; }
.tree .chapter { margin: 6px 0 2px; font-weight: 600; color: #243044; }
.tree .parter { display: block; padding: 2px 2px 2px 12px; color: #143; text-decoration: none; }
.tree .parter.on { background: #e4eef8; }
.steps { width: 100%; margin: 8px 0; }
.steps input { width: 100%; box-sizing: border-box; }
.steps tr.on { background: #e4eef8; }
.steps th { background: #f0f2f4; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; padding: 8px 10px; background: #fff; border: 1px solid #d0d4d8; }
.toolbar .hint { color: #666; font-size: 12px; }
.src-form label { margin-right: 10px; display: inline-block; }
.chapter { margin: 8px 0 2px; font-weight: 600; color: #243044; }
.fav-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fav-actions form.inline { display: inline; margin: 0; }
.muted { color: #667; font-size: 12px; }
.crumb a { color: #143; }
.hit .leaf { display: block; }
.hit .sid { display: block; color: #667; font-size: 11px; }
.head-row { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.photo { width: 72px; height: 72px; border: 1px solid #d0d4d8; display: flex; align-items: center; justify-content: center; background: #fafafa; overflow: hidden; }
.photo img { max-width: 72px; max-height: 72px; }
.panels a { margin-right: 10px; padding: 2px 8px; border: 1px solid #d0d4d8; text-decoration: none; color: #143; }
.panels a.on { background: #243044; color: #fff; border-color: #243044; }
.tree .drama { font-weight: 700; margin: 0 0 6px; color: #243044; }
.tree .tasks { margin: 0 0 8px 14px; padding-left: 6px; border-left: 2px solid #e4e7ea; }
.tree .tasks .hit { font-size: 13px; }
.tree .muted, .muted { color: #888; }
.summary { background: #eef3f8; border: 1px solid #c5d0dc; padding: 10px 12px; margin: 0 0 14px; }
.summary .line { margin: 4px 0; }
.badge { display: inline-block; padding: 1px 6px; margin: 0 4px 0 0; background: #a30; color: #fff; font-size: 12px; border-radius: 3px; }
.warn-item { margin: 3px 0 3px 8px; }
.steps tr.locked { background: #f7f3e8; }
table.sheet { width: 100%; font-size: 12px; }
table.sheet th { white-space: nowrap; background: #f0f2f4; }
table.sheet td { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.row.bind span { color: #243044; }
.tree .chapter-fold, .tree .parter-fold { margin: 0; }
.tree .chapter-fold > summary.chapter { list-style: none; cursor: pointer; }
.tree .chapter-fold > summary.chapter::-webkit-details-marker { display: none; }
.tree .chapter-fold > summary.chapter::before { content: "▾ "; color: #889; font-weight: 400; }
.tree .chapter-fold:not([open]) > summary.chapter::before { content: "▸ "; }
.tree .parter-fold > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 2px 2px 2px 8px; }
.tree .parter-fold > summary::-webkit-details-marker { display: none; }
.tree .parter-fold > summary::before { content: "▾ "; color: #889; font-size: 12px; }
.tree .parter-fold:not([open]) > summary::before { content: "▸ "; }
.tree .parter-fold .parter { display: inline; padding: 0; }
.tree .tasks .more { display: block; margin-top: 4px; }
.tree .tree-tools { margin: 0 0 8px; font-size: 13px; }
.tree .tree-tools a { margin-right: 6px; }

table.props { width: 100%; border-collapse: collapse; font-size: 13px; }
table.props th, table.props td { border: 1px solid #dde1e6; padding: 4px 6px; vertical-align: top; }
table.props th { background: #f3f5f8; text-align: left; }
table.props td.key { white-space: nowrap; width: 140px; }
table.props td.desc { color: #556; width: 28%; }
table.props tr.sep td { border: none; height: 8px; background: transparent; }
table.props input[type=text], table.props textarea { width: 100%; box-sizing: border-box; }
.btn-detail { display: inline-block; padding: 2px 8px; background: #1a5fb4; color: #fff !important; border-radius: 3px; text-decoration: none; font-size: 12px; }
.btn-detail.on { background: #0b3b75; }
.step-detail { margin: 12px 0; padding: 10px; border: 2px solid #1a5fb4; border-radius: 6px; background: #f7faff; }
.hint-box { padding: 8px 10px; background: #fff8e6; border: 1px solid #e6d9a8; border-radius: 4px; }
.status.ok { border-left: 4px solid #2a7; padding: 8px 10px; background: #eefaf2; }
.status.bad { border-left: 4px solid #a30; padding: 8px 10px; background: #fff0ee; }
.warn-item a { color: #a30; }
.panel-entry { margin: 8px 0 12px; padding: 8px; border: 1px solid #dde1e6; border-radius: 4px; background: #fafbfd; }
.panel-source { margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.src-tag { display: inline-block; padding: 1px 8px; background: #243044; color: #fff; border-radius: 3px; font-size: 12px; font-weight: 600; }
.badge.empty-field { background: #a67c00; }

.level-empty { color: #99a !important; opacity: 0.55; }
.levels strong.level-empty { font-weight: 600; opacity: 0.7; }
.attr-all { margin: 12px 0; border: 1px solid #dde1e6; border-radius: 4px; background: #fafbfd; padding: 6px 10px; }
.attr-all > summary { cursor: pointer; font-size: 15px; font-weight: 600; margin: 4px 0 8px; }
.muted.more { margin-top: 8px; }


/* Skill detail polish */
.skill-detail { position: relative; padding-bottom: 64px; }
.meta-line { margin: 4px 0 8px; color: #334; }
.pack-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; padding: 10px; background: #f3f6fa; border: 1px solid #d5dde8; border-radius: 6px; }
.pack-bar-title { font-weight: 700; color: #243044; margin-right: 4px; }
.pack-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px; border: 1px solid #b8c4d4; border-radius: 6px; background: #fff; cursor: pointer; text-align: left; }
.pack-chip:hover { border-color: #1a5fb4; background: #f0f6ff; }
.pack-chip .pack-label { font-size: 12px; color: #556; }
.pack-chip .pack-id { font-size: 13px; font-weight: 600; color: #143; font-family: Consolas, monospace; }
.panel-card { border: 1px solid #dde3ea; border-radius: 8px; padding: 12px; background: #fff; box-shadow: 0 1px 2px rgba(20,40,70,.04); }
.panel-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.panel-card-head h2 { margin: 0; }
table.sheet.editable { font-size: 12px; }
table.sheet.editable th { position: sticky; top: 0; z-index: 1; background: #eef2f7; }
table.sheet.editable td.lvl { font-weight: 700; white-space: nowrap; background: #f7f9fc; }
table.sheet.editable td.ro { color: #667; background: #fafbfc; max-width: 140px; }
table.sheet.editable tr.on { background: #eef6ff; }
table.sheet.editable input[type=text] { min-width: 72px; width: 100%; padding: 3px 5px; border: 1px solid #c9d2dc; border-radius: 3px; }
.pack-cell { display: flex; gap: 4px; align-items: center; }
.pack-cell input { flex: 1; }
.pack-open { padding: 2px 8px; font-size: 12px; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; margin-top: 14px; padding: 10px 12px; background: rgba(255,255,255,.96); border-top: 1px solid #d0d4d8; display: flex; gap: 12px; align-items: center; box-shadow: 0 -4px 12px rgba(0,0,0,.04); }
button.primary { background: #1a5fb4; color: #fff; border: 1px solid #0f4b93; border-radius: 4px; padding: 8px 16px; font-weight: 600; }
button.primary:hover { background: #0f4b93; }
.pack-dialog { border: none; border-radius: 10px; padding: 0; width: min(1100px, 96vw); height: min(820px, 92vh); box-shadow: 0 16px 48px rgba(0,0,0,.28); }
.pack-dialog::backdrop { background: rgba(20,30,45,.45); }
.pack-dialog-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #243044; color: #fff; }
.pack-dialog-bar button { background: #fff; border: 0; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.pack-dialog iframe { width: 100%; height: calc(100% - 44px); border: 0; background: #f4f5f6; }

.login-box { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid #d0d4d8; padding: 20px 24px; }
.login-box .row { grid-template-columns: 80px 1fr; }
header { display: flex; align-items: center; flex-wrap: wrap; }
header .header-right { margin-left: auto; }
header .user { color: #c8d2e0; margin-right: 12px; }

/* Per-field meaning hints (shared _Field) */
.row label { cursor: help; line-height: 1.25; }
.row label .field-face { display: block; font-weight: 600; }
.row label .field-key {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #889;
  font-weight: 400;
  font-family: Consolas, "Courier New", monospace;
}
.row label .field-hint {
  display: inline-block;
  margin-left: 4px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  background: #e8eef6;
  color: #1a5fb4;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  vertical-align: text-top;
}
