/* ============================================================
   TABLO EDİTÖRÜ (Excel benzeri spreadsheet)
   ============================================================ */
.sheet-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head .back-link { margin-bottom: 0; }
.embed-preview-btn { width: auto; flex-shrink: 0; }

#sheetApp {
    --cellw: 116px; --cellh: 28px; --rowhdr: 50px;
    --smono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
    display: flex; flex-direction: column;
    height: calc(100vh - 150px); min-height: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius); overflow: hidden;
}

/* Araç çubuğu */
.s-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px; background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.s-title { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 700; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.s-title svg { width: 16px; height: 16px; color: var(--accent); }
.s-name-edit { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; padding: 0; border: 0; background: none; color: var(--text-muted); border-radius: 7px; cursor: pointer; transition: .14s; flex-shrink: 0; }
.s-name-edit:hover { color: var(--accent); background: var(--bg-elevated); }
.s-name-edit svg { width: 15px; height: 15px; color: inherit; }

/* Kurumsal onay akışı: taslak (Onaya Gönder) çubuğu */
.draft-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 3500; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--accent); box-shadow: 0 12px 40px rgba(0,0,0,.35); max-width: 94vw; }
.draft-bar[hidden] { display: none; }
.draft-bar > svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.draft-info { font-size: 13.5px; color: var(--text-primary); white-space: nowrap; }
.draft-info b { color: var(--accent-bright); }
.draft-bar #draftNote { flex: 1; min-width: 120px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--bg-surface); color: var(--text-primary); font-size: 13px; }
@media (max-width: 620px) { .draft-bar #draftNote { display: none; } .draft-info { white-space: normal; } }

/* Meşgul kilidi uyarı şeridi (salt okunur) */
.busy-banner { display: flex; align-items: center; gap: 9px; padding: 10px 14px; margin: 0 0 8px; border-radius: 11px; background: rgba(217,83,79,.12); border: 1px solid rgba(217,83,79,.4); color: #d9534f; font-size: 13.5px; font-weight: 600; }
.busy-banner svg { width: 17px; height: 17px; flex-shrink: 0; }
.s-tools { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; flex: 1; min-width: 0; overflow-x: auto; }
.s-tools::-webkit-scrollbar { height: 0; }
.s-btn {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    background: var(--bg-surface-2); border: 1px solid var(--border-strong);
    color: var(--text-secondary); padding: 5px 10px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600; transition: all .15s ease;
}
.s-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.s-btn svg { width: 14px; height: 14px; }
.s-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b; border: none; }
.s-btn.primary:hover { filter: brightness(1.08); }
.s-btn.blue { background: var(--accent-soft); color: var(--accent-bright); border-color: var(--accent-dim); }
.s-grp { display: flex; gap: 2px; background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: 7px; padding: 2px; flex-shrink: 0; }
.s-grp button { padding: 4px 9px; border-radius: 5px; color: var(--text-secondary); font-size: 12.5px; }
.s-grp button:hover { background: var(--bg-base); color: var(--text-primary); }
.s-grp button.on { background: var(--accent); color: #07221b; }
/* Renk butonları */
/* Renk butonları artık .s-btn gibi (ikon + yazı, aynı yükseklik); gizli color input üstte */
.s-color-lbl { position: relative; cursor: pointer; }
.s-color-lbl .s-color-a { font-weight: 800; font-size: 13px; line-height: 1; }
.s-color-lbl input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; padding: 0; background: none; }

/* Satır başlığı "Form" butonu */
.rh-form {
    position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
    width: 17px; height: 17px; border-radius: 4px; cursor: pointer; z-index: 3;
    display: grid; place-items: center; color: var(--accent-bright); background: var(--bg-surface);
    opacity: 0; transition: opacity .12s ease; border: 1px solid var(--border);
}
#grid tbody tr:hover .rh-form, #grid th.rowhdr.sel .rh-form { opacity: 1; }
.rh-form:hover { background: var(--accent-soft); }
.rh-form::before { content: ''; width: 9px; height: 8px; background:
    linear-gradient(currentColor,currentColor) 0 0/100% 1.6px no-repeat,
    linear-gradient(currentColor,currentColor) 0 50%/100% 1.6px no-repeat,
    linear-gradient(currentColor,currentColor) 0 100%/100% 1.6px no-repeat; }

/* Satır → Form modalı */
.rowform-modal { max-width: 460px; }
.rowform-body { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; padding: 4px 2px 10px; }
.rf-field { display: flex; flex-direction: column; gap: 5px; }
.rf-field label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rf-col { font-size: 11px; color: var(--text-muted); font-family: var(--smono); }
.rf-lock { font-size: 11px; color: var(--warning); }
.rf-input { padding: 11px 13px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 15px; outline: none; }
.rf-input:focus { border-color: var(--accent); }
.rf-input[readonly] { opacity: .55; cursor: not-allowed; }
.rowform-foot { justify-content: space-between; }
.rf-nav { display: flex; align-items: center; gap: 6px; }
.rf-nav button { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-secondary); background: var(--bg-surface-2); border: 1px solid var(--border-strong); }
.rf-nav button:hover:not(:disabled) { color: var(--accent-bright); border-color: var(--accent-dim); }
.rf-nav button:disabled { opacity: .35; cursor: not-allowed; }
.rf-nav button svg { width: 16px; height: 16px; }
.rf-pos { font-size: 12.5px; color: var(--text-muted); font-family: var(--smono); min-width: 52px; text-align: center; }
.rf-actions { display: flex; align-items: center; gap: 10px; }
.s-hint { color: var(--text-muted); font-size: 11.5px; }
.s-hint b { color: var(--accent-bright); font-weight: 600; }
.s-icon-btn {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 7px;
    display: inline-grid; place-items: center; margin-left: 4px;
    background: var(--bg-surface-2); border: 1px solid var(--border-strong);
    color: var(--text-secondary); transition: all .15s ease;
}
.s-icon-btn:hover { color: var(--accent-bright); border-color: var(--accent-dim); }
.s-icon-btn svg { width: 16px; height: 16px; }

/* Değişiklik geçmişi modalı */
.hist-modal { max-width: 560px; padding: 0; overflow: hidden; }
.hist-modal .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); margin: 0; }
.hist-body { max-height: 64vh; overflow: auto; padding: 8px 14px 14px; }

/* ---- Tablo analizi paneli ---- */
.s-analyze-btn { background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%); border-color: transparent; color: #fff; }
.s-analyze-btn:hover { filter: brightness(1.08); }
.analysis-modal { max-width: 720px; width: 92vw; padding: 0; overflow: hidden; }
.analysis-modal .modal-head { padding: 15px 18px; border-bottom: 1px solid var(--border); margin: 0; display: flex; align-items: center; justify-content: space-between; }
.analysis-head-actions { display: inline-flex; align-items: center; gap: 8px; }
.analysis-body { max-height: 70vh; overflow: auto; padding: 16px 18px 20px; }
.analysis-loading, .analysis-error { text-align: center; color: var(--text-muted); padding: 40px 16px; font-size: 14px; }
.analysis-error { color: #ef4444; }
.an-spin { width: 30px; height: 30px; margin: 0 auto 12px; border: 3px solid var(--accent-dim); border-top-color: var(--accent-bright); border-radius: 50%; animation: an-rot 0.8s linear infinite; }
@keyframes an-rot { to { transform: rotate(360deg); } }
.an-sec-title { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-bright); margin: 18px 0 8px; }
.an-sec-title:first-child { margin-top: 0; }
.an-summary { font-size: 14.5px; line-height: 1.6; color: var(--text-primary); }
.an-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.an-metric { background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; min-width: 90px; }
.an-metric b { display: block; font-size: 17px; color: var(--text-primary); }
.an-metric span { font-size: 11.5px; color: var(--text-muted); }
.an-insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.an-insights li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.5; color: var(--text-primary); }
.an-insights li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--accent-bright); }
.an-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.an-table th, .an-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); }
.an-table th { color: var(--text-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.an-table td.an-num { text-align: right; font-variant-numeric: tabular-nums; }
.an-badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-bright); }
.an-badge.num { background: rgba(16,185,129,.15); color: #10b981; }
.an-badge.date { background: rgba(245,158,11,.15); color: #f59e0b; }
.hist-loading, .hist-empty { text-align: center; color: var(--text-muted); padding: 36px 16px; font-size: 13.5px; }
.hist-empty i { width: 34px; height: 34px; display: inline-block; margin-bottom: 8px; }
.hist-empty svg { width: 34px; height: 34px; }
.hist-list { display: flex; flex-direction: column; }
.hist-item { display: flex; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.hist-item:last-child { border-bottom: none; }
.hist-av {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
    background: var(--accent-soft); color: var(--accent-bright);
}
.hist-main { flex: 1; min-width: 0; }
.hist-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hist-top b { font-size: 13.5px; }
.hist-when { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.hist-change { margin-top: 4px; font-size: 13px; color: var(--text-secondary); font-family: var(--smono); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hist-cell { font-weight: 700; color: var(--accent-bright); background: var(--bg-base); padding: 1px 7px; border-radius: 5px; }
.hist-arrow { width: 14px; height: 14px; color: var(--text-muted); }
.hv-empty { color: var(--text-muted); font-style: italic; }
.hv-formula { color: var(--text-primary); }
.hv-calc { color: var(--accent); }
.hist-more { text-align: center; color: var(--text-muted); font-size: 12px; padding: 12px 0 4px; }

/* Formül çubuğu */
.s-fbar { display: flex; align-items: center; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.s-namebox { width: 80px; text-align: center; font-family: var(--smono); font-weight: 700; padding: 8px; border-right: 1px solid var(--border); color: var(--accent-bright); }
.s-fx {
    padding: 0 14px; min-width: 56px; height: 100%; align-self: stretch;
    color: var(--text-muted); font-style: italic; font-family: var(--smono); font-size: 13px;
    border: none; border-right: 1px solid var(--border); background: transparent;
    cursor: pointer; transition: all .15s ease; display: inline-flex; align-items: center; gap: 5px;
}
.s-fx:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.s-fx.ai {
    color: #07221b; font-style: normal; font-weight: 700;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent2, #1f9d7c));
}
.s-mic {
    width: 42px; align-self: stretch; display: inline-grid; place-items: center;
    background: transparent; border: none; border-right: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; transition: all .15s ease;
}
.s-mic:hover { color: var(--accent-bright); background: var(--bg-surface-2); }
.s-mic svg { width: 16px; height: 16px; }
.s-mic.rec { color: #fff; background: var(--danger); }
.s-mic.rec svg { animation: micpulse 1s ease-in-out infinite; }
@keyframes micpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.18); } }

#formulaInput { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); padding: 8px 12px; font-family: var(--smono); font-size: 13px; }
#formulaInput.ai { font-family: var(--sans, "Plus Jakarta Sans", sans-serif); font-style: normal; color: var(--accent-bright); }
#formulaInput:disabled { opacity: .6; }
.s-ai-go {
    display: inline-grid; place-items: center; width: 38px; align-self: stretch;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b;
    border: none; border-left: 1px solid var(--border); cursor: pointer;
}
.s-ai-go:hover { filter: brightness(1.1); }
.s-ai-go svg { width: 16px; height: 16px; }

/* fx mod seçici (dropdown) */
.s-fx-wrap { position: relative; align-self: stretch; display: flex; }
.s-fx { gap: 6px; }
.s-fx-caret { width: 13px; height: 13px; opacity: .7; }
.s-fx-menu {
    position: absolute; top: 100%; left: 0; z-index: 60; min-width: 230px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 6px; margin-top: 4px;
    box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.s-fx-menu button {
    display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
    padding: 9px 11px; border-radius: 7px; color: var(--text-primary); font-size: 13px;
}
.s-fx-menu button:hover { background: var(--bg-surface-2); }
.s-fx-menu button b { font-family: var(--smono); color: var(--accent-bright); min-width: 78px; font-weight: 700; }
.s-fx-menu button span { color: var(--text-muted); font-size: 12px; }

/* AI sonuç paneli */
.ai-panel {
    background: var(--bg-surface); border-bottom: 1px solid var(--border);
    max-height: 42vh; display: flex; flex-direction: column; animation: rise .25s ease both;
}
/* hidden attribute'u .ai-panel'in display:flex'ini ezebilsin diye açık override */
.ai-panel[hidden] { display: none; }
.ai-hint { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.ai-hint b { color: var(--accent-bright); font-weight: 600; }
.ai-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 14px; background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 13px; color: var(--accent-bright); font-family: var(--font-display);
}
.ai-panel-x { color: var(--text-muted); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.ai-panel-x:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.ai-panel-x svg { width: 15px; height: 15px; }
.ai-panel-body { overflow: auto; padding: 14px; }

.ai-summary { font-size: 13.5px; line-height: 1.55; color: var(--text-primary); margin-bottom: 12px; }
.ai-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; font-family: var(--smono); }
.ai-err { color: var(--danger); font-size: 13.5px; padding: 8px 0; }
.ai-loading { color: var(--text-muted); font-size: 13px; padding: 6px 0; }

.ai-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ai-table th, .ai-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.ai-table th { color: var(--text-muted); font-weight: 600; }
.ai-table td.num, .ai-table th.num { text-align: right; font-family: var(--smono); }
.ai-table tr.fc-pred td { color: var(--accent-bright); }

.ai-kpis { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ai-kpis .kpi { flex: 1; min-width: 120px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ai-kpis .kpi span { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.ai-kpis .kpi b { font-size: 17px; font-family: var(--smono); }
.ai-kpis .kpi.pos b { color: var(--accent-bright); }
.ai-kpis .kpi.neg b { color: var(--danger); }

/* Sohbet baloncukları */
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 78%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.chat-u { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b; border-bottom-right-radius: 4px; }
.chat-a { align-self: flex-start; background: var(--bg-surface-2); color: var(--text-primary); border-bottom-left-radius: 4px; position: relative; padding-right: 34px; }
.chat-tts { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--text-muted); transition: all .15s ease; }
.chat-tts:hover { color: var(--accent-bright); background: var(--bg-base); }
.chat-tts svg { width: 15px; height: 15px; }
.chat-tts.playing { color: #07221b; background: var(--accent); }
.chat-tts.playing svg { animation: ttspulse 1s ease-in-out infinite; }
@keyframes ttspulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.chat-e { align-self: flex-start; background: rgba(240,85,109,.12); border: 1px solid rgba(240,85,109,.4); color: var(--danger); }
.chat-loading { display: flex; gap: 4px; }
.chat-loading span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: chatdot 1.2s infinite; }
.chat-loading span:nth-child(2) { animation-delay: .2s; }
.chat-loading span:nth-child(3) { animation-delay: .4s; }
@keyframes chatdot { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* Izgara */
.s-gridwrap { flex: 1; overflow: auto; background: var(--bg-base); position: relative; -webkit-overflow-scrolling: touch; }
#grid { user-select: none; -webkit-user-select: none; }
#grid td input { user-select: text; -webkit-user-select: text; }
#grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; }
#grid th, #grid td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: var(--cellh); overflow: hidden; white-space: nowrap; }
#grid thead th { position: sticky; top: 0; z-index: 3; background: var(--bg-surface-2); color: var(--text-muted); font-weight: 600; text-align: center; width: var(--cellw); user-select: none; }
#grid thead th.corner { left: 0; z-index: 5; width: var(--rowhdr); }
#grid th.rowhdr { position: sticky; left: 0; z-index: 2; background: var(--bg-surface-2); color: var(--text-muted); font-weight: 600; text-align: center; width: var(--rowhdr); user-select: none; }
#grid th.colhdr.sel, #grid th.rowhdr.sel { background: var(--accent-soft); color: var(--accent-bright); }
#grid td { width: var(--cellw); padding: 0; cursor: cell; position: relative; }
#grid td .cv { padding: 4px 7px; height: 100%; overflow: hidden; text-overflow: ellipsis; font-family: var(--smono); font-size: 12.5px; line-height: 20px; }
#grid td.num .cv { text-align: right; }
#grid td.err .cv { color: var(--danger); }
#grid td.bold .cv { font-weight: 700; }
#grid td.italic .cv { font-style: italic; }
#grid td.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); z-index: 1; }
#grid td.inrange { background: var(--accent-soft); }
#grid td input { width: 100%; height: 100%; border: none; outline: none; background: var(--bg-elevated); color: var(--text-primary); font-family: var(--smono); font-size: 12.5px; padding: 4px 7px; }
#grid col.cg-rowhdr { width: var(--rowhdr); }
/* Sütun genişliği tutamacı */
#grid th.colhdr { position: sticky; }
.col-resize { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 4; }
.col-resize:hover { background: var(--accent); opacity: .55; }
body.col-resizing { cursor: col-resize; user-select: none; }
/* Birleşmiş hücre */
#grid td.merged { background: var(--bg-surface); }
#grid td.merged .cv { white-space: normal; }

/* Hücre bağlam menüsü (sağ tık / uzun basma) */
.cell-menu {
    position: fixed; z-index: 400; min-width: 188px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
    animation: rise .12s ease both;
}
.cell-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 7px; color: var(--text-primary); font-size: 13px; }
.cell-menu button:hover { background: var(--bg-surface-2); }
.cell-menu button svg { width: 15px; height: 15px; color: var(--text-muted); }
.cm-sep { height: 1px; background: var(--border); margin: 5px 6px; }

/* ===== Hücre korumaları (kilit / maske / gizleme / not) göstergeleri ===== */
#grid td.cell-locked { box-shadow: inset 3px 0 0 var(--warning); }
#grid td.cell-locked::before { content: "🔒"; position: absolute; top: 0; left: 2px; font-size: 8px; opacity: .85; line-height: 1; pointer-events: none; }
#grid td.cell-masked { background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.04) 5px, rgba(255,255,255,.04) 10px); }
#grid td.cell-masked .cv { color: var(--text-muted); letter-spacing: 1px; }
#grid td.cell-hidden { opacity: .4; }
#grid td.has-note::after { content: ""; position: absolute; top: 0; right: 0; border-width: 5px; border-style: solid; border-color: var(--danger) var(--danger) transparent transparent; pointer-events: none; }
#grid th.colhdr.col-hidden, #grid th.rowhdr.row-hidden { color: var(--danger); opacity: .7; text-decoration: line-through; }

/* ===== Not popup'ı ===== */
.note-pop { position: fixed; z-index: 350; width: 290px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); overflow: hidden; }
.note-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--bg-surface-2); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.note-list { max-height: 200px; overflow: auto; padding: 8px 10px; }
.note-empty { color: var(--text-muted); font-size: 12.5px; text-align: center; padding: 14px 0; }
.note-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: none; }
.note-text { flex: 1; font-size: 12.5px; line-height: 1.45; color: var(--text-primary); }
.note-del { flex-shrink: 0; color: var(--text-muted); width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; }
.note-del:hover { color: var(--danger); background: var(--bg-surface); }
.note-del svg { width: 13px; height: 13px; }
.note-add { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); }
.note-add textarea { flex: 1; resize: none; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-primary); font-size: 12.5px; padding: 7px 9px; font-family: inherit; }
.note-add .btn-sm { width: auto; padding: 7px 10px; }

/* ===== Güvenlik modalı (owner) ===== */
.sec-modal { max-width: 520px; }
.sec-body { display: flex; flex-direction: column; gap: 20px; }
.sec-section { display: flex; flex-direction: column; gap: 8px; }
.sec-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.sec-row { display: flex; gap: 8px; }
.sec-row input { flex: 1; padding: 10px 12px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; outline: none; }
.sec-row input:focus { border-color: var(--accent); }
.sec-hint { font-size: 12px; color: var(--text-muted); }
.sec-hint b { color: var(--accent-bright); }
.prot-list { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow: auto; }
.prot-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px 0; }
.prot-item { position: relative; background: var(--bg-base); border: 1px solid var(--border); border-radius: 10px; padding: 10px 36px 10px 12px; }
.prot-main { font-size: 13px; }
.prot-exc-row { font-size: 12px; color: var(--text-secondary); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prot-exc { background: var(--accent-soft); color: var(--accent-bright); border-radius: 12px; padding: 2px 8px; }
.prot-exc a { color: var(--danger); cursor: pointer; font-weight: 700; margin-left: 2px; }
.prot-grant { background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text-secondary); font-size: 12px; padding: 4px 6px; }
.prot-del { position: absolute; top: 8px; right: 8px; color: var(--text-muted); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; }
.prot-del:hover { color: var(--danger); background: var(--bg-surface); }
.prot-del svg { width: 15px; height: 15px; }
.muted { color: var(--text-muted); }

/* Durum çubuğu */
.s-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--bg-elevated); border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.s-stats { display: flex; gap: 18px; font-family: var(--smono); }

/* Toast */
.s-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent-dim); color: #07221b; padding: 10px 18px; border-radius: 9px; opacity: 0; transition: .28s ease; pointer-events: none; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 80%; z-index: 300; font-size: 13px; }
.s-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.s-toast.err { background: var(--danger); color: #fff; }

@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
    .s-hint { display: none; }
}

/* Tablo editörü — mobil / dokunmatik uyum */
@media (max-width: 640px) {
    #sheetApp { --cellw: 90px; --cellh: 40px; --rowhdr: 48px; }
    .rh-form { opacity: .9; }                 /* dokunmatikte hover yok → her zaman görünür */
    #grid th.rowhdr .rh-num { font-size: 10px; }
    /* Araç çubuğu: tek satır, yatay kaydırılır (tüm butonlar erişilebilir kalır) */
    .s-toolbar { gap: 7px; padding: 8px 10px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .s-toolbar::-webkit-scrollbar { height: 0; }
    .s-title { font-size: 12.5px; flex-shrink: 0; }
    .s-title span { display: inline-block; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
    .s-tools { flex-wrap: nowrap; gap: 6px; flex: 0 0 auto; }
    .s-btn { padding: 9px 11px; font-size: 12px; white-space: nowrap; }
    .s-grp button { padding: 8px 12px; }
    .s-icon-btn { width: 40px; height: 40px; }
    /* Formül çubuğu: kompakt, dokunmatik dostu */
    .s-namebox { width: 50px; font-size: 12px; padding: 9px 3px; }
    .s-fx { padding: 0 9px; min-width: 0; }
    .s-fx-caret { display: none; }
    .s-mic, .s-ai-go { width: 40px; }
    #formulaInput { font-size: 16px; padding: 11px 10px; }   /* 16px: iOS/WebView odakta otomatik zoom yapmaz */
    .s-fx-menu { min-width: 210px; }
    /* Hücreler ve başlıklar */
    #grid td .cv { padding: 9px 7px; font-size: 13px; line-height: 20px; }
    #grid td input { font-size: 16px; padding: 9px 7px; }
    #grid thead th, #grid th.rowhdr { font-size: 11px; }
    /* Durum çubuğu kompakt */
    .s-status { padding: 6px 10px; font-size: 11px; }
    .s-stats { gap: 12px; }
    .ai-panel { max-height: 52vh; }
    /* Detay sayfasında üst başlık + embed butonu mobilde küçülsün */
    .sheet-head { margin-bottom: 8px; }
    .embed-preview-btn { padding: 8px 10px; font-size: 12px; }
}

/* ============================================================
   EMBED (mobil WebView — tam ekran tablo editörü)
   ============================================================ */
.embed-body { height: 100vh; height: 100dvh; overflow: hidden; }
.embed-body #sheetApp {
    height: 100vh; height: 100dvh;
    border: none; border-radius: 0;
}
.embed-msg { display: grid; place-items: center; height: 100vh; height: 100dvh; padding: 24px; }
.embed-msg-card {
    text-align: center; max-width: 360px;
    background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 36px 28px;
}
.embed-msg-card > i { color: var(--text-muted); width: 40px; height: 40px; display: inline-block; }
.embed-msg-card svg { width: 40px; height: 40px; }
.embed-msg-card h2 { font-family: var(--font-display); font-size: 22px; margin: 14px 0 8px; }
.embed-msg-card p { color: var(--text-secondary); font-size: 14px; }
.embed-msg-hint { display: block; margin-top: 16px; color: var(--text-muted); font-size: 12.5px; }

