:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans", "PingFang SC", sans-serif;
  color: rgba(255,255,255,.95);
  background: #1c1c1e;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { line-height: 1.55; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand strong, .card-title { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
[hidden] { display: none !important; }
::selection { background: rgba(255,255,255,.20); color: rgba(255,255,255,.95); }

.app-shell {
  display: grid;
  grid-template-columns: 210px minmax(320px, 400px) minmax(0, 1fr);
  min-height: 100dvh;
  background: #1c1c1e;
}
.sidebar, .list-panel, .content-panel { min-width: 0; }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 30px 16px 24px;
  background: rgba(28,28,30,.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: #3a3a3c;
  color: rgba(255,255,255,.95);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; line-height: 1.2; }
.brand small { margin-top: 4px; color: rgba(255,255,255,.70); font-size: 12px; }
.sidebar-label { margin: 0 8px -16px; color: rgba(255,255,255,.70); font-size: 12px; }
.main-tabs { display: grid; gap: 4px; }
.main-tabs button, .button, .chips button, .close, .feedback-card {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: #3a3a3c;
  color: rgba(255,255,255,.90);
  transition: background-color .2s ease-out, border-color .2s ease-out, color .2s ease-out;
}
.main-tabs button { width: 100%; padding: 10px 12px; text-align: left; font-size: 14px; }
.main-tabs button.active { background: rgba(255,255,255,.10); color: rgba(255,255,255,.95); }
.main-tabs button:hover, .button:hover, .chips button:hover, .close:hover { background: rgba(255,255,255,.08); }
.main-tabs button.active:hover { background: rgba(255,255,255,.10); }
.sidebar-actions { display: grid; gap: 8px; margin-top: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.button.primary { background: #3a3a3c; color: rgba(255,255,255,.95); }
.button.subtle { background: #3a3a3c; }
.button.more { display: flex; width: 100%; margin-top: 16px; }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.list-panel { padding: 32px 22px 40px; background: #2c2c2e; border-right: 1px solid rgba(255,255,255,.08); }
.section-heading { margin-bottom: 22px; }
.section-heading h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: rgba(255,255,255,.70); font-size: 13px; }
.chips { display: flex; gap: 7px; overflow-x: auto; margin: 0 -22px 16px; padding: 0 22px 4px; scrollbar-width: thin; }
.chips button { flex: none; padding: 7px 10px; font-size: 12px; }
.chips button.active { background: rgba(255,255,255,.10); color: rgba(255,255,255,.95); }
.card-list { display: grid; gap: 9px; }
.feedback-card { display: block; width: 100%; padding: 16px; background: #2c2c2e; text-align: left; border-color: rgba(255,255,255,.08); border-radius: 12px; }
.feedback-card:hover { background: #3a3a3c; }
.feedback-card.selected { background: #3a3a3c; border-color: rgba(255,255,255,.12); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-title { margin: 12px 0 6px; color: rgba(255,255,255,.95); font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.card-excerpt { margin: 0 0 15px; color: rgba(255,255,255,.70); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-foot { color: rgba(255,255,255,.70); font-size: 12px; }
.pill { display: inline-flex; align-items: center; padding: 4px 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 6px; background: #3a3a3c; color: rgba(255,255,255,.70); font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans", "PingFang SC", sans-serif; font-size: 11px; line-height: 1.2; }
.pill[class*="status-"] { color: rgba(255,255,255,.95); }
.empty { padding: 24px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #2c2c2e; color: rgba(255,255,255,.70); font-size: 13px; line-height: 1.5; }
.progress-grid { display: grid; gap: 22px; }
.progress-column { min-width: 0; }
.progress-column + .progress-column { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.progress-column h3 { margin: 0 0 12px; font-size: 18px; }
.progress-column h3 .pill { font-size: 13px; }

.content-panel { padding: 32px clamp(24px, 4vw, 64px); background: #3a3a3c; }
.detail-placeholder { max-width: 660px; }
.detail-placeholder h2 { margin-bottom: 8px; font-size: 24px; }
.detail-placeholder p { color: rgba(255,255,255,.70); font-size: 14px; }
.panel-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 24px; overflow: auto; border: 1px solid rgba(255,255,255,.10); border-radius: 12px; background: #2c2c2e; color: rgba(255,255,255,.95); }
.panel-dialog::backdrop { background: rgba(28,28,30,.88); }
.panel-dialog.small-dialog { width: min(500px, calc(100vw - 24px)); }
.detail-dialog[open]:not(:modal) { position: static; display: block; width: 100%; max-width: 740px; max-height: none; margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-head h2 { margin: 10px 0 5px; font-size: 28px; line-height: 1.25; overflow-wrap: anywhere; }
.dialog-head p { margin: 4px 0 0; }
.close { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; font-size: 22px; line-height: 1; }
.muted { color: rgba(255,255,255,.70); font-size: 13px; }
.reader { padding-top: 18px; margin-bottom: 24px; border-top: 1px solid rgba(255,255,255,.10); overflow-wrap: anywhere; }
.reader.ql-container { border: 0; color: rgba(255,255,255,.95); font-size: 15px; }
.reader .ql-editor { max-width: 72ch; padding: 0; line-height: 1.7; }
.reader .ql-editor img { max-width: 100%; border-radius: 8px; }
.reply { max-width: 72ch; padding: 18px; border: 1px solid rgba(255,255,255,.10); border-radius: 12px; background: #2c2c2e; }
.reply strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.reply p { margin: 8px 0 0; color: rgba(255,255,255,.70); white-space: pre-wrap; overflow-wrap: anywhere; }
.panel-dialog form, .admin-detail form { display: grid; gap: 16px; }
.panel-dialog label, .admin-detail label { display: grid; gap: 7px; color: rgba(255,255,255,.95); font-size: 13px; font-weight: 600; }
.panel-dialog input, .panel-dialog select, .panel-dialog textarea, .admin-detail input, .admin-detail select, .admin-detail textarea {
  width: 100%; min-height: 42px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10); border-radius: 8px;
  background: #1c1c1e; color: rgba(255,255,255,.90);
  outline: none;
  transition: background-color .2s ease-out, border-color .2s ease-out, color .2s ease-out;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.40); }
.panel-dialog input:focus, .panel-dialog select:focus, .panel-dialog textarea:focus, .admin-detail input:focus, .admin-detail select:focus, .admin-detail textarea:focus { border-color: rgba(255,255,255,.25); }
.admin-detail textarea { resize: vertical; }
.hint { margin: -8px 0 0; color: rgba(255,255,255,.70); font-size: 12px; }
.message { min-height: 18px; margin: 0; color: rgba(255,255,255,.70); font-size: 13px; }
.message[data-state="error"] { color: rgba(255,255,255,.95); }
.receipt-form { grid-template-columns: 1fr auto; align-items: end; }
.receipt-code { display: block; margin-bottom: 16px; padding: 14px; overflow-wrap: anywhere; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: #1c1c1e; color: rgba(255,255,255,.90); font-family: "SF Mono", Menlo, monospace; font-size: 12px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 10px 14px; border: 1px solid rgba(255,255,255,.10); border-radius: 8px; background: #3a3a3c; color: rgba(255,255,255,.95); font-size: 13px; opacity: 0; pointer-events: none; }
.toast.visible { opacity: 1; }

.ql-toolbar.ql-snow, #editor.ql-container.ql-snow { border: 1px solid rgba(255,255,255,.10); background: #1c1c1e; color: rgba(255,255,255,.90); }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; }
#editor.ql-container.ql-snow { height: 220px; border-top: 0; border-radius: 0 0 8px 8px; }
.ql-editor.ql-blank::before { color: rgba(255,255,255,.40); font-style: normal; }
.ql-snow .ql-stroke { stroke: rgba(255,255,255,.70); }
.ql-snow .ql-fill { fill: rgba(255,255,255,.70); }
.ql-snow .ql-picker { color: rgba(255,255,255,.70); }
.ql-snow .ql-picker-options, .ql-snow .ql-tooltip { border: 1px solid rgba(255,255,255,.10); background: #3a3a3c; color: rgba(255,255,255,.95); }
.ql-snow .ql-tooltip input[type="text"] { background: #1c1c1e; color: rgba(255,255,255,.95); }
.ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: rgba(255,255,255,.10); }

.admin-detail { max-width: 740px; }
.admin-detail .reader { max-height: 38vh; overflow: auto; }
.admin-detail form { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.10); }
:focus-visible { outline: 1px solid rgba(255,255,255,.70); outline-offset: 2px; }
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { gap: 16px; padding: 18px 16px 14px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .main-tabs { display: flex; }
  .main-tabs button { width: auto; flex: 1; text-align: center; }
  .sidebar-actions { display: flex; margin-top: 0; }
  .sidebar-actions .button { flex: 1; }
  .sidebar-label { margin: 0; }
  .list-panel { min-height: calc(100dvh - 156px); padding: 26px 16px 36px; border-right: 0; }
  .chips { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .content-panel:not(.admin-content) { height: 0; padding: 0; overflow: visible; }
  .content-panel:not(.admin-content) .detail-placeholder { display: none; }
  .admin-content { padding: 26px 16px 36px; border-top: 1px solid rgba(255,255,255,.08); }
  .admin-shell .list-panel { min-height: 0; }
  .panel-dialog { max-height: calc(100dvh - 16px); padding: 18px; }
  .detail-dialog:modal { width: min(680px, calc(100vw - 16px)); }
}
@media (max-width: 520px) {
  .section-heading h1 { font-size: 26px; }
  .dialog-head h2 { font-size: 24px; }
  .receipt-form { grid-template-columns: 1fr; }
  .admin-shell .main-tabs { flex-wrap: wrap; }
  .admin-shell .main-tabs button { flex: 1 0 calc(33.333% - 4px); }
}
@media (prefers-reduced-motion: reduce) {
  .main-tabs button, .button, .chips button, .close, .feedback-card,
  .panel-dialog input, .panel-dialog select, .panel-dialog textarea,
  .admin-detail input, .admin-detail select, .admin-detail textarea { transition: none; }
}
