.grant-panel { padding: 16px; }
.grant-panel h1 { font-size: 20px; margin-bottom: 10px; }
.grant-panel h2 { font-size: 16px; margin: 0; }
.grant-field { display: grid; gap: 5px; font-size: 13px; min-width: 0; }
.grant-field textarea { font: inherit; resize: vertical; }
.grant-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.grant-save-status { font-size: 12px; color: #62758a; margin-left: auto; }
.grant-ready-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.grant-manual-note { font-size: 12px; margin: 0 0 12px; }
.grant-source { margin: 12px 0; border: 1px solid #dce4ec; border-radius: 6px; }
.grant-source > summary { cursor: pointer; padding: 10px 12px; font-weight: 650; }
.grant-source[open] > summary { border-bottom: 1px solid #dce4ec; background: #f5f8fb; }
.grant-source-body { padding: 12px; display: grid; gap: 12px; }
.grant-import { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.grant-import label { flex: 1; }
.grant-source-count { margin-top: -7px; font-size: 12px; }
.grant-limit-exceeded { color: #ac2424; }
.grant-structure-actions { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.grant-structure-actions label { width: 100px; }
.grant-ai-note { margin: 0; font-size: 12px; }
.grant-progress { padding: 9px 12px; border-radius: 5px; background: #edf5fc; color: #245d89; }
.grant-progress[hidden] { display: none; }
.grant-error { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.grant-notice { background: #edf4f9; padding: 10px 12px; border-radius: 5px; }
.grant-editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.grant-outline { border: 1px solid #dce4ec; background: #f7f9fb; border-radius: 6px; padding: 12px; min-width: 0; }
.grant-slide-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 7px; max-height: 610px; overflow-y: auto; }
.grant-slide-item { display: flex; border: 1px solid #dce4ec; border-radius: 5px; background: #fff; min-width: 0; }
.grant-slide-item.is-active { border-color: #287b98; box-shadow: 0 0 0 1px #287b98; }
.grant-slide-choice { flex: 1; min-width: 0; padding: 9px 7px; border: 0; text-align: left; display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 5px; align-items: start; background: transparent; cursor: pointer; color: #2d4359; }
.grant-slide-number { color: #6a7e8f; font-size: 12px; }
.grant-slide-caption { overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
.grant-slide-gap { color: #8d5c10; grid-column: 2; font-size: 10px; }
.grant-slide-moves { display: grid; align-content: center; gap: 3px; padding: 4px; }
.grant-slide-moves .btn { min-height: 23px; width: 25px; padding: 0 4px; font-size: 13px; }
.grant-add-area { display: grid; gap: 8px; }
.grant-slide-editor { min-width: 0; }
.grant-slide-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.grant-block-description { margin: 6px 0 12px; font-size: 12px; }
.grant-slide-preview { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 8px; overflow: hidden; background: #18334d; box-shadow: 0 3px 12px #18334d15; display: flex; justify-content: center; align-items: center; }
.grant-slide-preview > p { padding: 20px; color: #fff; }
.grant-slide-canvas { display: block; width: 100%; height: auto; }
.grant-questions { margin: 12px 0; padding: 10px 12px; background: #fff7e8; border: 1px solid #edd6a9; border-radius: 5px; font-size: 12px; }
.grant-questions[hidden] { display: none; }
.grant-questions ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.grant-question-link { border: 0; background: none; color: #795215; padding: 0; text-align: left; text-decoration: underline; cursor: pointer; font: inherit; }
.grant-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.grant-field-group { min-width: 0; padding: 10px; border: 1px solid #dce4ec; border-radius: 5px; }
.grant-field-group:has(textarea) { grid-column: 1 / -1; }
.grant-field-label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
.grant-field-lock { margin-top: 7px; font-size: 11px; color: #62758a; }
.grant-photo-field { display: grid; gap: 7px; }
.grant-photo-thumb { width: 88px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid #dce4ec; }
.grant-photo-field small { font-size: 11px; line-height: 1.35; }
.grant-photo-field .btn { justify-self: start; }
.grant-slide-ai { display: grid; gap: 10px; border-top: 1px solid #dce4ec; padding-top: 14px; }
.grant-slide-ai > button { justify-self: start; }
.ai-usage-pipeline { display: block; margin-top: 3px; color: #62758a; }
.grant-slide-ai > p { margin: 0; font-size: 12px; }
.grant-source-refs { padding: 10px; margin: 12px 0; background: #f5f8fb; border-radius: 5px; font-size: 12px; }
.grant-source-refs summary { cursor: pointer; font-weight: 600; }
.grant-source-refs p { white-space: pre-wrap; }
.grant-team-editor { display: grid; gap: 12px; margin: 14px 0; }
.grant-team-editor > p { margin: 0; font-size: 12px; }
.grant-team-member { min-width: 0; border: 1px solid #c5d7e2; border-radius: 7px; padding: 12px; margin: 0; }
.grant-team-member > legend { width: auto; font-size: 14px; font-weight: 650; padding: 0 6px; }
.grant-team-member > .row-actions { justify-content: flex-end; }
.grant-team-member .grant-fields { margin-bottom: 0; }
.grant-team-editor > .btn { justify-self: start; }
.grant-empty { padding: 40px 24px; border: 1px dashed #b9c7d4; border-radius: 8px; color: #62758a; text-align: center; }
.ai-usage-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 14px 0; }
.ai-usage-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.ai-usage-stat { border: 1px solid #dce4ec; border-radius: 6px; padding: 12px; }
.ai-usage-stat strong { display: block; font-size: 24px; color: #18334d; margin-bottom: 4px; }
.ai-usage-stat span { font-size: 12px; color: #62758a; }
.ai-usage-table-wrap { overflow-x: auto; border: 1px solid #dce4ec; border-radius: 5px; }
.ai-usage-table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
.ai-usage-table th, .ai-usage-table td { padding: 9px 10px; border-bottom: 1px solid #dce4ec; text-align: left; }
.ai-usage-table th { font-weight: 600; background: #f5f8fb; }
.ai-usage-table tr:last-child td { border-bottom: 0; }
.ai-usage-status { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 11px; background: #edf4f9; }
.ai-usage-status.is-failed { color: #ac2424; background: #fff0ed; }
.ai-usage-status.is-pending { color: #8d5c10; background: #fff7e8; }
.ai-usage-note { margin-top: 10px; font-size: 12px; }
.ai-quota-section { border-bottom: 1px solid #dce4ec; padding-bottom: 22px; margin-bottom: 22px; }
.ai-quota-section h2 { margin-top: 20px; }
.ai-journal-panel h1 { margin-bottom: 14px; }
.ai-journal-summary { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.ai-journal-summary strong { margin-right: 12px; color: #18334d; }
.ai-journal-table { min-width: 0; }
.ai-journal-table .resize_block_table { min-width: 0; flex: 1; }
.ai-journal-table .resize_block_table > div:last-child { overflow-x: auto; }
.ai-journal-table .table-filters { flex-shrink: 0; }
.ai-journal-table .ai-usage-table { min-width: 750px; }
.ai-journal-table .ai-usage-table td.ai-journal-number { text-align: right; font-variant-numeric: tabular-nums; }
.ai-journal-table .ai-usage-table th:nth-child(n+4) { text-align: right; }
.ai-journal-table .ai-usage-table tfoot { background: #f5f8fb; font-weight: 650; }
.ai-journal-table .ai-usage-table tfoot th { text-align: left; }
.ai-journal-meta, .ai-journal-unknown { display: block; color: #62758a; font-weight: 400; margin-top: 3px; font-size: 10px; }
.ai-journal-operation { white-space: normal; min-width: 190px; }
.ai-journal-operation .ai-usage-status { margin-top: 5px; }
.ai-journal-table[aria-busy="true"] .pagination { pointer-events: none; opacity: .5; }
.ai-journal-panel .form-error:empty { display: none; }
.ai-accounting-period-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 12px 0; }
.ai-accounting-month { display: grid; gap: 6px; width: min(240px, 100%); }
.ai-quota-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.ai-quota-card { border: 1px solid #dce4ec; border-radius: 6px; padding: 14px; }
.ai-quota-card h3 { margin: 0 0 12px; font-size: 17px; }
.ai-quota-statistics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ai-quota-statistics dt { color: #62758a; font-size: 12px; }
.ai-quota-statistics dd { margin: 3px 0 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.ai-quota-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 9px 12px; padding: 12px 0; }
.ai-quota-form label { display: grid; gap: 6px; overflow-wrap: anywhere; }
.ai-quota-form small, .ai-quota-form-message { grid-column: 1 / -1; margin: 0; }
.ai-quota-form-message:empty { display: none; }
.ai-accounting-settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-accounting-settings-form > .btn { justify-self: start; }
.ai-quota-users { display: grid; gap: 12px; }
.ai-quota-user { border: 1px solid #dce4ec; border-radius: 6px; padding: 0 14px; }
.ai-quota-user > p { margin-top: 0; font-size: 12px; }
.ai-quota-history-table { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
.ai-quota-history-table th, .ai-quota-history-table td { padding: 9px 10px; border-bottom: 1px solid #dce4ec; text-align: left; }
.ai-quota-history-table th { background: #f5f8fb; font-weight: 600; }
.ai-quota-history-table tr:last-child td { border-bottom: 0; }
.ai-diagnostic-dialog.ai-quota-resolution-dialog { width: min(620px, 94vw); }
.ai-quota-resolution-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ai-quota-resolution-form label { display: grid; gap: 6px; }
.ai-quota-resolution-error, .ai-quota-resolution-actions { grid-column: 1 / -1; }
.ai-quota-resolution-error:empty { display: none; }
.ai-quota-resolution-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 480px) { .ai-quota-resolution-form { grid-template-columns: minmax(0, 1fr); } .ai-quota-resolution-actions .btn { width: 100%; white-space: normal; } }
@media (max-width: 720px) { .ai-quota-cards { grid-template-columns: minmax(0, 1fr); } .ai-quota-form { grid-template-columns: minmax(0, 1fr); } .ai-quota-form .btn { width: 100%; } .ai-quota-user { padding: 0 10px; } }
.ai-diagnostic-dialog { width: min(1080px, 94vw); max-height: 88vh; overflow: auto; border: 1px solid #dce4ec; border-radius: 8px; padding: 20px; }
.ai-diagnostic-dialog::backdrop { background: #13283b88; }
.ai-diagnostic-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.ai-diagnostic-header h2 { font-size: 20px; margin: 0; }
.ai-diagnostic-stage { margin: 12px 0; }
.ai-diagnostic-stage summary { font-weight: 600; cursor: pointer; }
.ai-diagnostic-stage pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f8fb; padding: 12px; font-size: 12px; max-height: 50vh; overflow: auto; }
.ai-pricing-list { display: grid; gap: 14px; margin-top: 14px; }
.grant-delete-button { color: #9e2828; border-color: #d9a9a9; }
.grant-delete-button:hover:not(:disabled) { color: #7b1717; background: #fff0ed; border-color: #b75858; }
.ai-pricing-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(140px, .7fr) minmax(140px, .7fr) minmax(230px, 1.4fr); gap: 12px; align-items: center; padding: 14px; border: 1px solid #dce4ec; border-radius: 6px; }
.ai-pricing-heading { display: grid; gap: 5px; overflow-wrap: anywhere; }
.ai-pricing-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-pricing-note { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.ai-pricing-success { color: #27643f; white-space: pre-wrap; }
@media (max-width: 1100px) { .ai-pricing-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ai-pricing-heading, .ai-pricing-actions { grid-column: 1 / -1; } }
@media (max-width: 600px) { .ai-pricing-row { grid-template-columns: minmax(0, 1fr); padding: 12px; } .ai-pricing-actions .btn { width: 100%; white-space: normal; } }
@media (min-width: 1450px) { .grant-editor { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 980px) { .grant-editor { grid-template-columns: 210px minmax(0, 1fr); gap: 12px; } .grant-fields { grid-template-columns: 1fr; } .ai-usage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grant-panel { padding: 12px; } .grant-editor { grid-template-columns: 1fr; } .grant-slide-list { max-height: 280px; } .grant-slide-choice { padding: 11px 8px; } .grant-slide-moves { display: flex; } .grant-slide-moves .btn { min-height: 30px; width: 30px; } .grant-save-status { flex-basis: 100%; margin-left: 0; } .grant-import { align-items: stretch; flex-direction: column; } .grant-import .btn { align-self: start; } .grant-slide-heading { align-items: flex-start; } .grant-fields { grid-template-columns: 1fr; } .ai-usage-summary { gap: 8px; } .ai-usage-stat { padding: 10px; } .ai-usage-stat strong { font-size: 19px; } .ai-usage-filters label { width: calc(50% - 5px); } }
