:root { font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif; color: #253043; background: #f6f7f9; --ledger-font: 12px; }
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; }
header { padding: 12px 16px 6px; border-bottom: 1px solid #c6cbd3; background: #fff; }
.title { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
h1 { font-size: 18px; margin: 0; }
a { color: #425777; text-decoration: none; font-size: 13px; }
#branch-label { font-size: 12px; color: #667085; }
#refresh { margin-left: auto; }
form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #5d6778; }
.search { flex: 1; min-width: 240px; }
input, select, button { font: inherit; font-size: 12px; min-height: 30px; border: 1px solid #b8c0cc; border-radius: 4px; padding: 5px 8px; background: #fff; color: #253043; }
button { cursor: pointer; }
button:hover { background: #edf2f8; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #3b75c8; outline-offset: 1px; }
button:disabled { opacity: .5; cursor: wait; }
#status { font-size: 12px; color: #596477; min-height: 18px; margin: 7px 0 0; }
#status.error { color: #b42318; }
main { min-height: 0; flex: 1; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
#table-scroll { overflow: auto; flex: 1; min-height: 0; background: #fff; }
table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--ledger-font); line-height: 1.4; }
th, td { border-right: 1px solid #d2d6dc; border-bottom: 1px solid #d2d6dc; text-align: left; }
th { position: sticky; top: 0; z-index: 3; padding: 0; background: #fff2cb; box-shadow: 0 1px #aab2be; white-space: nowrap; }
th button { width: 100%; border: 0; border-radius: 0; text-align: left; background: transparent; font-weight: 600; min-height: 30px; padding: 4px 6px; }
.ticket-row { cursor: pointer; }
.ticket-row > td { height: 28px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
th:nth-child(1), .ticket-row > td:nth-child(1) { position: sticky; left: 0; width: 60px; }
th:nth-child(2), .ticket-row > td:nth-child(2) { position: sticky; left: 60px; width: 88px; }
th:nth-child(3), .ticket-row > td:nth-child(3) { position: sticky; left: 148px; width: 120px; box-shadow: 1px 0 #aab2be; }
th:nth-child(-n+3) { z-index: 4; }
.ticket-row > td:nth-child(-n+3) { z-index: 1; }
.ticket-row > td { background: #fff; }
.ticket-row:nth-child(even) > td { background: #fafbfc; }
.ticket-row:hover > td { background: #edf3fb; }
.ticket-row.selected > td { background: #e3edfa; }
.ticket-row:focus-visible { outline: 2px solid #3b75c8; outline-offset: -2px; }
td.money { text-align: right; font-variant-numeric: tabular-nums; }
.row-toggle { display: flex; align-items: center; gap: 3px; padding: 0; border: 0; background: transparent; border-radius: 0; min-height: 0; font: inherit; width: 100%; }
.row-arrow { color: #68768a; font-size: 10px; }
.ticket-thread-row > td { padding: 0; background: #f5f8fc; border-bottom: 1px solid #aebdd0; }
.ticket-expanded { position: sticky; left: 0; width: min(100%, calc(100vw - 16px)); display: grid; grid-template-columns: minmax(220px, 30%) minmax(0, 1fr); gap: 24px; padding: 18px 22px; white-space: normal; }
.ticket-expanded h2 { font-size: 12px; font-weight: 600; color: #56657a; margin: 0 0 8px; }
.ticket-expanded p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-context section + section { margin-top: 16px; }
.thread-list { margin: 0 0 0 5px; padding: 0 0 0 20px; list-style: none; border-left: 1px solid #b9c9df; }
.thread-entry { position: relative; margin-bottom: 12px; padding: 10px 12px; background: #fff; border: 1px solid #d8e0eb; border-radius: 5px; }
.thread-entry:last-child { margin-bottom: 0; }
.thread-entry::before { content: ''; position: absolute; left: -25px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: #7490b5; border: 2px solid #f5f8fc; }
.thread-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; color: #718096; font-size: 11px; }
.thread-kind { font-weight: 600; color: #315c8a; }
.is-memo .thread-kind { color: #7a5a32; }
.thread-current { color: #8b94a2; }
.thread-empty { color: #7c8799; }
#more { padding: 16px; width: min(100%, 600px); text-align: center; }
footer { padding: 6px 16px; border-top: 1px solid #c6cbd3; font-size: 12px; background: #f4f6f9; }
.empty { padding: 30px; }
@media (max-width: 700px) { header { padding: 8px; } .title { gap: 8px; } form { gap: 6px; } .search { flex-basis: 100%; } .ticket-expanded { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; } }
