/* =====================================================
   RESET
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #172033;
}


/* =====================================================
   TOP BAR
===================================================== */

.topbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #dfe4ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: #2563eb;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.brand-text h1 {
    font-size: 20px;
    line-height: 1.1;
    color: #172033;
}

.brand-text span {
    font-size: 12px;
    color: #64748b;
}

.back-btn {
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
}

.back-btn:hover {
    background: #eff6ff;
}


/* =====================================================
   MAIN
===================================================== */

.container {
    width: min(1500px, 96%);
    margin: 0 auto;
    padding: 35px 0 70px;
}

.intro {
    margin-bottom: 25px;
}

.intro h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #111827;
}

.intro p {
    max-width: 850px;
    color: #64748b;
    line-height: 1.6;
    font-size: 15px;
}


/* =====================================================
   KNOWLEDGE SECTION
===================================================== */

.knowledge-section {
    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}


/* =====================================================
   SHEET TITLE
===================================================== */

.sheet-title {
    min-height: 70px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d9dee7;
}

.sheet-title strong {
    display: block;
    font-size: 17px;
    color: #111827;
}

.sheet-title span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.sheet-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
}

.sheet-count #annotationCount {
    font-weight: 700;
    color: #2563eb;
    font-size: 16px;
}


/* =====================================================
   SEARCH
===================================================== */

.search-area {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #d9dee7;
}

.search-area input {
    width: 100%;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 13px;
    outline: none;
    font-size: 14px;
    background: #ffffff;
}

.search-area input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}


/* =====================================================
   SHEET HEADER
===================================================== */

.sheet-header {
    display: grid;
    grid-template-columns: 65px minmax(300px, 1fr) minmax(400px, 2fr) 190px;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
}

.sheet-header-cell {
    padding: 12px 14px;
    border-right: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.04em;
}

.sheet-header-cell:last-child {
    border-right: none;
}

.number-column {
    text-align: center;
}


/* =====================================================
   ROW
===================================================== */

.annotation-row {
    display: grid;
    grid-template-columns: 65px minmax(300px, 1fr) minmax(400px, 2fr) 190px;
    border-bottom: 1px solid #d9dee7;
    min-height: 76px;
    background: #ffffff;
}

.annotation-row:hover {
    background: #fafcff;
}

.annotation-cell {
    padding: 12px 14px;
    border-right: 1px solid #d9dee7;
    min-width: 0;
}

.annotation-cell:last-child {
    border-right: none;
}


/* =====================================================
   NUMBER
===================================================== */

.number-cell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 18px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
}


/* =====================================================
   QUESTION
===================================================== */

.question-cell {
    color: #172033;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.question-text {
    font-size: 14px;
    line-height: 1.55;
}


/* =====================================================
   ANSWER
===================================================== */

.answer-cell {
    color: #334155;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.answer-text {
    font-size: 14px;
    white-space: pre-wrap;
}

.empty-answer {
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
    padding-top: 2px;
}


/* =====================================================
   NEW QUESTION ROW
===================================================== */

.new-question-row {
    background: #f8fbff;
}

.new-question-row:hover {
    background: #f8fbff;
}

.new-question-row textarea {
    width: 100%;
    min-height: 48px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: white;
}

.new-question-row textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}


/* =====================================================
   ACTION
===================================================== */

.annotation-action {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.add-question-btn {
    border: none;
    background: #2563eb;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.add-question-btn:hover {
    background: #1d4ed8;
}


/* =====================================================
   EDIT BUTTON
===================================================== */

.edit-btn {
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    padding: 8px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.edit-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}


/* =====================================================
   LOCK BUTTON
===================================================== */

.lock-btn-small {
    border: none;
    background: #16a34a;
    color: white;
    padding: 8px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.lock-btn-small:hover {
    background: #15803d;
}


/* =====================================================
   LOCKED ROW
===================================================== */

.locked-row {
    background: #f8fafc;
}

.locked-row:hover {
    background: #f8fafc;
}

.locked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 5px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}


/* =====================================================
   STATUS
===================================================== */

.draft-badge {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 5px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
}


/* =====================================================
   LOADING
===================================================== */

.loading-row {
    padding: 35px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.empty-row {
    padding: 35px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}


/* =====================================================
   MESSAGE
===================================================== */

.message {
    min-height: 0;
    padding: 0;
    font-size: 13px;
}

.message.success {
    padding: 10px 16px;
    color: #166534;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}

.message.error {
    padding: 10px 16px;
    color: #b91c1c;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
}


/* =====================================================
   MODAL
===================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 500;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: min(700px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}


/* =====================================================
   MODAL HEADER
===================================================== */

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 19px;
    color: #111827;
    margin-bottom: 5px;
}

.modal-header p {
    font-size: 13px;
    color: #64748b;
}

.close-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    color: #475569;
}

.close-btn:hover {
    background: #e2e8f0;
}


/* =====================================================
   FORM
===================================================== */

#editForm {
    padding: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
}

.form-group textarea,
.form-group input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 11px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}


/* =====================================================
   LOCK WARNING
===================================================== */

.lock-warning {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    margin-bottom: 20px;
}

.lock-icon {
    font-size: 20px;
}

.lock-warning strong {
    color: #9a3412;
    font-size: 13px;
}

.lock-warning p {
    margin-top: 4px;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.5;
}


/* =====================================================
   MODAL BUTTONS
===================================================== */

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cancel-btn,
.save-btn,
.lock-btn {
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.cancel-btn {
    background: #e2e8f0;
    color: #334155;
}

.cancel-btn:hover {
    background: #cbd5e1;
}

.save-btn {
    background: #2563eb;
    color: white;
}

.save-btn:hover {
    background: #1d4ed8;
}

.lock-btn {
    background: #16a34a;
    color: white;
}

.lock-btn:hover {
    background: #15803d;
}


/* =====================================================
   RESET
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #172033;
}


/* =====================================================
   TOP BAR
===================================================== */

.topbar {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #dfe4ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: #2563eb;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.brand-text h1 {
    font-size: 20px;
    line-height: 1.1;
    color: #172033;
}

.brand-text span {
    font-size: 12px;
    color: #64748b;
}

.back-btn {
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
}

.back-btn:hover {
    background: #eff6ff;
}


/* =====================================================
   MAIN
===================================================== */

.container {
    width: min(1500px, 96%);
    margin: 0 auto;
    padding: 35px 0 70px;
}

.intro {
    margin-bottom: 25px;
}

.intro h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #111827;
}

.intro p {
    max-width: 850px;
    color: #64748b;
    line-height: 1.6;
    font-size: 15px;
}


/* =====================================================
   KNOWLEDGE SECTION
===================================================== */

.knowledge-section {
    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}


/* =====================================================
   SHEET TITLE
===================================================== */

.sheet-title {
    min-height: 70px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d9dee7;
}

.sheet-title strong {
    display: block;
    font-size: 17px;
    color: #111827;
}

.sheet-title span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.sheet-count {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
}

.sheet-count #annotationCount {
    font-weight: 700;
    color: #2563eb;
    font-size: 16px;
}


/* =====================================================
   SEARCH
===================================================== */

.search-area {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #d9dee7;
}

.search-area input {
    width: 100%;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 13px;
    outline: none;
    font-size: 14px;
    background: #ffffff;
}

.search-area input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}


/* =====================================================
   SHEET HEADER
===================================================== */

.sheet-header {
    display: grid;
    grid-template-columns: 65px minmax(300px, 1fr) minmax(400px, 2fr) 190px;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
}

.sheet-header-cell {
    padding: 12px 14px;
    border-right: 1px solid #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.04em;
}

.sheet-header-cell:last-child {
    border-right: none;
}

.number-column {
    text-align: center;
}


/* =====================================================
   ROW
===================================================== */

.annotation-row {
    display: grid;
    grid-template-columns: 65px minmax(300px, 1fr) minmax(400px, 2fr) 190px;
    border-bottom: 1px solid #d9dee7;
    min-height: 76px;
    background: #ffffff;
}

.annotation-row:hover {
    background: #fafcff;
}

.annotation-cell {
    padding: 12px 14px;
    border-right: 1px solid #d9dee7;
    min-width: 0;
}

.annotation-cell:last-child {
    border-right: none;
}


/* =====================================================
   NUMBER
===================================================== */

.number-cell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 18px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
}


/* =====================================================
   QUESTION
===================================================== */

.question-cell {
    color: #172033;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.question-text {
    font-size: 14px;
    line-height: 1.55;
}


/* =====================================================
   ANSWER
===================================================== */

.answer-cell {
    color: #334155;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.answer-text {
    font-size: 14px;
    white-space: pre-wrap;
}

.empty-answer {
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
    padding-top: 2px;
}


/* =====================================================
   NEW QUESTION ROW
===================================================== */

.new-question-row {
    background: #f8fbff;
}

.new-question-row:hover {
    background: #f8fbff;
}

.new-question-row textarea {
    width: 100%;
    min-height: 48px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: white;
}

.new-question-row textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}


/* =====================================================
   ACTION
===================================================== */

.annotation-action {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.add-question-btn {
    border: none;
    background: #2563eb;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.add-question-btn:hover {
    background: #1d4ed8;
}


/* =====================================================
   EDIT BUTTON
===================================================== */

.edit-btn {
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    padding: 8px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.edit-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}


/* =====================================================
   LOCK BUTTON
===================================================== */

.lock-btn-small {
    border: none;
    background: #16a34a;
    color: white;
    padding: 8px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.lock-btn-small:hover {
    background: #15803d;
}


/* =====================================================
   LOCKED ROW
===================================================== */

.locked-row {
    background: #f8fafc;
}

.locked-row:hover {
    background: #f8fafc;
}

.locked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 5px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}


/* =====================================================
   STATUS
===================================================== */

.draft-badge {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 5px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
}


/* =====================================================
   LOADING
===================================================== */

.loading-row {
    padding: 35px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.empty-row {
    padding: 35px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}


/* =====================================================
   MESSAGE
===================================================== */

.message {
    min-height: 0;
    padding: 0;
    font-size: 13px;
}

.message.success {
    padding: 10px 16px;
    color: #166534;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
}

.message.error {
    padding: 10px 16px;
    color: #b91c1c;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
}


/* =====================================================
   MODAL
===================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 500;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: min(700px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}


/* =====================================================
   MODAL HEADER
===================================================== */

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 19px;
    color: #111827;
    margin-bottom: 5px;
}

.modal-header p {
    font-size: 13px;
    color: #64748b;
}

.close-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 22px;
    color: #475569;
}

.close-btn:hover {
    background: #e2e8f0;
}


/* =====================================================
   FORM
===================================================== */

#editForm {
    padding: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
}

.form-group textarea,
.form-group input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 11px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}


/* =====================================================
   LOCK WARNING
===================================================== */

.lock-warning {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    margin-bottom: 20px;
}

.lock-icon {
    font-size: 20px;
}

.lock-warning strong {
    color: #9a3412;
    font-size: 13px;
}

.lock-warning p {
    margin-top: 4px;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.5;
}


/* =====================================================
   MODAL BUTTONS
===================================================== */

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cancel-btn,
.save-btn,
.lock-btn {
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.cancel-btn {
    background: #e2e8f0;
    color: #334155;
}

.cancel-btn:hover {
    background: #cbd5e1;
}

.save-btn {
    background: #2563eb;
    color: white;
}

.save-btn:hover {
    background: #1d4ed8;
}

.lock-btn {
    background: #16a34a;
    color: white;
}

.lock-btn:hover {
    background: #15803d;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 900px) {
    .container {
        width: 98%;
    }
    .sheet-header,
    .annotation-row {
        grid-template-columns: 50px 280px 400px 180px;
        min-width: 910px;
    }
    .knowledge-section {
        overflow-x: auto;
    }
    .sheet-title,
    .search-area {
        min-width: 910px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 15px;
    }
    .brand-text h1 {
        font-size: 17px;
    }
    .back-btn {
        font-size: 12px;
    }
    .intro h2 {
        font-size: 23px;
    }
    .modal {
        padding: 10px;
    }
    .modal-content {
        max-height: 95vh;
    }
    .modal-actions {
        justify-content: stretch;
    }
    .cancel-btn,
    .save-btn,
    .lock-btn {
        flex: 1;
    }
    .chat-question {
        background: #e8f1f8;
        padding: 10px 14px;
        border-radius: 12px;
        margin-bottom: 10px;
        width: fit-content;
        max-width: 80%;
        margin-left: auto;
        font-size: 14px;
    }
    .ai-answer {
        background: #ffffff;
        padding: 14px 16px;
        border-radius: 12px;
        margin-bottom: 8px;
        max-width: 85%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    .knowledge-source {
        margin-top: 6px;
        margin-left: 4px;
        color: #198754;
        font-size: 12px;
        font-weight: 500;
    }
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 900px) {
    .container {
        width: 98%;
    }
    .sheet-header,
    .annotation-row {
        grid-template-columns: 50px 280px 400px 180px;
        min-width: 910px;
    }
    .knowledge-section {
        overflow-x: auto;
    }
    .sheet-title,
    .search-area {
        min-width: 910px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 15px;
    }
    .brand-text h1 {
        font-size: 17px;
    }
    .back-btn {
        font-size: 12px;
    }
    .intro h2 {
        font-size: 23px;
    }
    .modal {
        padding: 10px;
    }
    .modal-content {
        max-height: 95vh;
    }
    .modal-actions {
        justify-content: stretch;
    }
    .cancel-btn,
    .save-btn,
    .lock-btn {
        flex: 1;
    }
    .chat-question {
        background: #e8f1f8;
        padding: 10px 14px;
        border-radius: 12px;
        margin-bottom: 10px;
        width: fit-content;
        max-width: 80%;
        margin-left: auto;
        font-size: 14px;
    }
    .ai-answer {
        background: #ffffff;
        padding: 14px 16px;
        border-radius: 12px;
        margin-bottom: 8px;
        max-width: 85%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    .knowledge-source {
        margin-top: 6px;
        margin-left: 4px;
        color: #198754;
        font-size: 12px;
        font-weight: 500;
    }
}