:root { color-scheme: light; font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif; color: #18211d; background: #f3f5f3; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { border: 0; background: #176b4d; color: white; padding: 10px 14px; border-radius: 6px; cursor: pointer; font-weight: 650; }
button:hover { background: #105b40; }
button:disabled { opacity: .55; cursor: wait; }
button.secondary, .link-button { background: transparent; color: #305044; border: 1px solid #b9c6c0; }
.link-button { border: 0; padding-left: 0; }
input, select, textarea { width: 100%; border: 1px solid #b9c6c0; border-radius: 5px; padding: 10px; background: white; color: #18211d; }
input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-picker { min-height: 42px; border: 1px solid #b9c6c0; border-radius: 5px; padding: 5px; display: flex; align-items: center; gap: 10px; background: white; }
.file-button { background: #edf3ef; border: 1px solid #b9c6c0; border-radius: 4px; padding: 7px 11px; color: #1f4033; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }
.file-button:hover { background: #dfeae3; }
.file-picker span { color: #697871; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
textarea { resize: vertical; line-height: 1.5; }
label { display: grid; gap: 6px; font-size: 13px; color: #42544c; }
form { display: grid; gap: 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; letter-spacing: 0; }
h1, .brand { display: flex; align-items: center; gap: 10px; }
h1 img { width: 42px; height: 42px; object-fit: contain; }
h2 { font-size: 22px; margin-bottom: 5px; letter-spacing: 0; }
h3 { font-size: 16px; letter-spacing: 0; }
header p, .view > header p { color: #697871; margin-bottom: 0; font-size: 14px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8eeea; }
.auth-panel { width: min(400px, 100%); background: white; border: 1px solid #ced8d2; border-radius: 8px; padding: 30px; box-shadow: 0 12px 30px rgba(25, 45, 36, .08); }
.auth-panel form { margin: 24px 0 10px; }
.error { color: #a12525; min-height: 20px; font-size: 13px; }
.workspace { display: grid; min-height: 100vh; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: #182b23; color: white; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 21px; font-weight: 800; padding: 0 10px 25px; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
nav { display: grid; gap: 4px; }
nav button { text-align: left; background: transparent; color: #c9d8d1; }
nav button:hover, nav button.active { background: #29483a; color: white; }
.account { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #395046; display: grid; gap: 7px; }
.account span { font-size: 12px; color: #aebfb7; overflow-wrap: anywhere; }
.account button { color: #e2ebe7; border-color: #526b60; margin-top: 8px; }
.content { padding: 28px clamp(18px, 4vw, 56px); min-width: 0; }
.view { max-width: 1180px; margin: 0 auto; }
.view > header { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 24px; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 240px) auto; align-items: end; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid #d5ddd8; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e3e8e5; text-align: left; vertical-align: top; }
th { background: #f8faf9; color: #53645c; font-size: 12px; text-transform: uppercase; }
td button { padding: 6px 9px; font-size: 12px; }
.list { display: grid; gap: 10px; }
.list-item { background: white; border: 1px solid #d5ddd8; border-radius: 6px; padding: 15px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list-item .meta { color: #697871; font-size: 13px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions input { width: 180px; }
.chat-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 140px); border: 1px solid #d5ddd8; background: white; }
.conversation-list { border-right: 1px solid #d5ddd8; padding: 10px; overflow-y: auto; }
.conversation-list button { width: 100%; background: transparent; color: #30483e; text-align: left; font-weight: 500; }
.conversation-list button.active { background: #e8f1ec; color: #124e38; }
.chat-main { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.messages { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.message { max-width: 82%; border-radius: 7px; padding: 12px 14px; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; background: #176b4d; color: white; }
.message.assistant { align-self: flex-start; background: #edf1ef; }
.sources { font-size: 12px; color: #5f7068; margin-top: 8px; }
.composer { border-top: 1px solid #d5ddd8; padding: 14px; grid-template-columns: 150px 1fr auto; align-items: end; }
.notice { max-width: 1180px; margin: 0 auto 18px; padding: 11px 14px; border: 1px solid #d4aa4d; background: #fff8e7; border-radius: 5px; }
.balance { text-align: right; }
.balance span { display: block; color: #697871; font-size: 12px; }
.balance strong { font-size: 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-grid > section { background: white; border: 1px solid #d5ddd8; padding: 18px; }
.admin-grid > section, .list-item > * { min-width: 0; }
.compact-list { margin-top: 14px; font-size: 13px; display: grid; gap: 5px; }
.route-list { display: grid; gap: 8px; margin-top: 16px; }
.job-list { display: grid; gap: 6px; margin-bottom: 14px; }
.job-item { border-left: 3px solid #176b4d; background: #edf3ef; padding: 9px 12px; font-size: 13px; }
.job-item.failed { border-left-color: #a12525; background: #fff0f0; }
.route-item { border-top: 1px solid #e1e7e3; padding-top: 10px; display: flex; justify-content: space-between; gap: 10px; }
.route-status { margin-top: 5px; font-size: 12px; color: #66766e; }
.route-status.failed { color: #9c2f2f; }
.icon-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.warning-list { max-width: 1180px; margin: 0 auto 18px; border: 1px solid #d4aa4d; background: #fff8e7; padding: 12px 15px; }
.warning-list div + div { margin-top: 5px; }
.subheading { margin-top: 24px; }
.usage-summary { display: grid; gap: 10px; }
.usage-row { font-size: 12px; }
.usage-row > div { display: flex; justify-content: space-between; gap: 8px; }
.usage-bar { height: 6px; background: #e3e9e5; border-radius: 3px; overflow: hidden; margin-top: 5px; }
.usage-bar span { display: block; height: 100%; background: #176b4d; }
.generated-image { max-width: min(100%, 640px); height: auto; border-radius: 6px; display: block; }
@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { height: auto; position: static; padding: 12px; }
  .brand { padding: 4px 6px 12px; }
  nav { grid-template-columns: repeat(5, 1fr); overflow-x: auto; }
  nav button { text-align: center; padding: 9px 6px; font-size: 12px; }
  .account { grid-template-columns: 1fr auto; align-items: center; }
  .account span { display: none; }
  .account button { margin: 0; }
  .content { padding: 20px 12px; }
  .toolbar, .admin-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; min-height: 70vh; }
  .conversation-list { border-right: 0; border-bottom: 1px solid #d5ddd8; max-height: 130px; }
  .message { max-width: 94%; }
  .composer { grid-template-columns: 1fr auto; }
  .composer select { grid-column: 1 / -1; }
  .list-item { align-items: stretch; flex-direction: column; }
  .list-item .actions { width: 100%; }
  .list-item .actions input { flex: 1 1 150px; min-width: 0; width: auto; }
}
