/* =====================================================
   FreeDrive — Components (Google Drive Style)
   ===================================================== */

/* ── Context Menu ── */
.context-menu {
    position: fixed;
    min-width: 240px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 0;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
    z-index: 180;
}

.context-item {
    width: 100%;
    height: 34px;
    padding: 0 14px;
    border: none;
    background: transparent;
    color: #202124;
    text-align: left;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 120ms ease;
}

.context-item:hover {
    background: #f1f3f4;
}

.context-item.danger {
    color: #d93025;
}

.context-item.danger:hover {
    background: #fce8e6;
}

.context-divider {
    border-top: 1px solid #dadce0;
    margin: 5px 0;
}

/* Trash / Bin banner (Google Drive style) */
.trash-bin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
    padding: 10px 16px;
    background: #e8f0fe;
    border-radius: 8px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 14px;
    color: #3c4043;
}

.trash-bin-banner.hidden {
    display: none;
}

.trash-bin-banner-text {
    flex: 1;
    min-width: 0;
}

.trash-bin-empty-btn {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #1a73e8;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
}

.trash-bin-empty-btn:hover {
    text-decoration: underline;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    width: min(480px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 8px;
    border: none;
    background: #fff;
    box-shadow: 0 24px 38px 3px rgba(60,64,67,.3), 0 9px 46px 8px rgba(60,64,67,.15);
}

.modal-header {
    padding: 24px 24px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: 'Google Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin: 0;
}

.modal-body {
    padding: 16px 24px 24px;
    color: #202124;
}

.modal-footer {
    padding: 8px 24px 16px;
    border-top: none;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-footer .btn {
    height: 36px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-weight: 500;
    padding: 0 16px;
}

.modal-footer .btn-secondary {
    background: transparent;
    border: none;
    color: #1a73e8;
}

.modal-footer .btn-secondary:hover {
    background: #e8f0fe;
}

.modal-footer .btn-primary {
    background: #1a73e8;
    border: none;
    color: #fff;
}

.modal-footer .btn-primary:hover {
    background: #1557b0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.modal-footer .btn-danger {
    background: #d93025;
    border: none;
    color: #fff;
}

.modal-footer .btn-danger:hover {
    background: #a50e0e;
}

.open-with-modal {
    width: min(520px, 100%);
}

.open-with-modal .modal-header {
    align-items: flex-start;
}

.open-with-filename {
    max-width: 390px;
    margin: 5px 0 0;
    color: #5f6368;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.open-with-apps {
    display: grid;
    gap: 8px;
}

.open-with-app {
    width: 100%;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #202124;
    text-align: left;
    cursor: pointer;
}

.open-with-app:hover,
.open-with-app:focus-visible {
    border-color: #a8c7fa;
    background: #f0f4ff;
    outline: none;
}

.open-with-app-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.open-with-app-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 3px;
}

.open-with-app-title {
    font-size: 14px;
    font-weight: 600;
}

.open-with-app-description {
    color: #5f6368;
    font-size: 12px;
}

.open-with-recommended {
    padding: 3px 7px;
    border-radius: 999px;
    background: #e6f4ea;
    color: #137333;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── Share & Shortcuts Modals ── */
.share-modal { width: min(680px, 100%); }

.share-existing-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}
.share-existing-entry:last-child {
    border-bottom: none;
}
.share-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.share-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}
.share-name {
    font-size: 14px;
    color: #202124;
    font-weight: 500;
}
.share-email {
    font-size: 12px;
    color: #5f6368;
    font-weight: normal;
}
.share-meta {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}
.share-person > div {
    min-width: 0;
}
.share-name,
.share-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.owner-pill {
    font-size: 13px;
    color: #5f6368;
}
.share-existing-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.share-role-select {
    height: 34px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 0 30px 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    background: #fff;
    outline: none;
}
.share-role-select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8 inset;
}
.share-remove-btn {
    font-size: 13px;
    font-weight: 600;
}
.share-actions-placeholder {
    width: 0;
}
.shortcuts-modal { width: min(920px, 100%); max-height: 85vh; }

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.shortcut-group {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}

.shortcut-group h4 {
    font-family: 'Google Sans', 'Inter', sans-serif;
    color: #0b57d0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    color: #1f1f1f;
    font-size: 13px;
    font-family: 'Google Sans', 'Inter', sans-serif;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-key {
    min-width: 44px;
    text-align: center;
    padding: 3px 8px;
    border: 1px solid #dadce0;
    background: #fff;
    color: #444746;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    white-space: nowrap;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    left: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10005;
}

.toast {
    min-width: 280px;
    max-width: 460px;
    min-height: 48px;
    border-radius: 4px;
    border: none;
    background: #323232;
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(0,0,0,.23);
    font-family: 'Roboto', Arial, sans-serif;
}

.toast.toast-success { background: #1e8e3e; }
.toast.toast-error   { background: #d93025; }
.toast.toast-warning { background: #f9ab00; color: #202124; }
.toast.toast-info    { background: #323232; }

.toast-msg { font-size: 13px; }

.toast-action {
    border: none;
    background: transparent;
    color: #8ab4f8;
    cursor: pointer;
    font-weight: 700;
}

.toast-hide {
    opacity: 0;
    transform: translateY(8px);
    transition: .22s ease;
}

/* ── Editor Overlay ── */
.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-shell {
    width: min(98vw, 1720px);
    height: min(94vh, 1100px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 14px 48px rgba(0,0,0,0.26);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-toolbar {
    height: 56px;
    min-height: 56px;
    padding: 0 14px;
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8f9fa;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.editor-title input {
    border: 1px solid #dadce0;
    background: #fff;
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    font-family: 'Google Sans', Arial, sans-serif;
    outline: none;
    width: clamp(180px, 26vw, 420px);
    height: 36px;
    border-radius: 8px;
    padding: 0 10px;
}

.editor-status {
    font-size: 12px;
    color: #5f6368;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.editor-toolbar .btn {
    border-radius: 8px;
    font-weight: 500;
}

.editor-toolbar .btn-sm {
    height: 34px;
    padding: 0 12px;
}

.editor-toolbar .btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

/* ── Image Editor (Google Photos style) ── */
.image-editor-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: #151920;
}

.image-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-bottom: 1px solid #dadce0;
    background: #edf2fa;
    flex-shrink: 0;
}

.image-toolbar .tool-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.image-toolbar .tool-btn-icon {
    border: none;
    background: transparent;
}

.image-toolbar .tool-btn-icon.active {
    background: #c2e7ff;
    border-color: transparent;
}

.image-toolbar .tool-btn-icon.active .material-icons-outlined {
    color: #001d35;
}

.img-flip-v-icon {
    transform: rotate(90deg);
}

.image-editor-body {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.editor-canvas-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    background: radial-gradient(circle at top, #1f2430 0%, #151920 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.editor-canvas-wrap canvas { max-width: 100%; max-height: 100%; }

.zoom-indicator,
.selection-indicator {
    position: absolute;
    bottom: 10px;
    background: rgba(32,33,36,.8);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    color: #fff;
    z-index: 2;
}

.zoom-indicator { right: 10px; }
.selection-indicator { left: 10px; }

.image-panel {
    width: 280px;
    max-width: 100%;
    background: #fff;
    border-left: 1px solid #dadce0;
    box-shadow: -4px 0 16px rgba(0,0,0,.12);
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 3;
}

.image-panel.open {
    display: flex;
}

.image-panel[hidden] {
    display: none !important;
}

.image-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #dadce0;
    background: #f8f9fa;
}

.image-panel-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
}

.image-panel-body {
    padding: 12px;
    overflow: auto;
    flex: 1;
}

.img-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.img-preset-list .tool-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 100px;
    justify-content: center;
}

/* ── Tool Panel ── */
.tool-group { margin-bottom: 10px; }
.tool-group h5 { font-size: 12px; color: #5f6368; margin-bottom: 8px; font-weight: 600; }
.tool-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tool-btn {
    border: 1px solid #dadce0;
    background: #fff;
    color: #202124;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Roboto', Arial, sans-serif;
    transition: background-color .18s, border-color .18s, color .18s;
}

.tool-btn:hover {
    background: #eef3fd;
    border-color: #c7d7f8;
}

.tool-btn.active {
    border-color: #1a73e8;
    background: #e8f0fe;
    color: #1a73e8;
}

.tool-input { width: 100%; margin-top: 6px; }
.adjust-row { margin-bottom: 10px; font-size: 12px; }
.adjust-row label { display: flex; justify-content: space-between; margin-bottom: 6px; color: #5f6368; font-weight: 500; }
.adjust-row input[type='range'] { width: 100%; accent-color: #1a73e8; }

/* ── Text Editor ── */
.text-editor-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    min-height: 0;
}

.text-editor-docs {
    background: #f3f3f3;
}

.text-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-bottom: 1px solid #dadce0;
    background: #edf2fa;
    flex-shrink: 0;
}

.tool-sep {
    width: 1px;
    height: 20px;
    background: #c4c7c5;
    margin: 0 6px;
    flex-shrink: 0;
}

.tool-btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    background: transparent;
}

.tool-btn-icon .material-icons-outlined {
    font-size: 20px;
    line-height: 1;
    color: #444746;
}

.tool-btn-icon:hover {
    background: #d3e3fd;
    border-color: transparent;
}

.tool-btn-icon.active {
    background: #c2e7ff;
    border-color: transparent;
    color: #001d35;
}

.tool-btn-icon.active .material-icons-outlined {
    color: #001d35;
}

.tool-select {
    height: 32px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #202124;
    font-size: 13px;
    font-family: 'Roboto', Arial, sans-serif;
    padding: 0 6px;
    max-width: 140px;
    cursor: pointer;
}

.tool-select:hover {
    background: #d3e3fd;
}

.tool-color {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.tool-color:hover {
    background: #d3e3fd;
}

.tool-color .material-icons-outlined {
    font-size: 20px;
    color: #444746;
    pointer-events: none;
}

.tool-color input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
}

.text-editor-scroll {
    flex: 1;
    overflow: auto;
    background: #f3f3f3;
    padding: 24px 16px 40px;
    min-height: 0;
}

.text-editor {
    flex: 1;
    overflow: auto;
    padding: 16px;
    outline: none;
    line-height: 1.6;
    font-size: 15px;
    background: #fff;
    color: #202124;
}

.text-editor-page {
    flex: none;
    width: min(100%, 8.5in);
    min-height: 11in;
    margin: 0 auto;
    padding: 1in;
    background: #fff;
    color: #202124;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    overflow: visible;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
}

.text-editor-page:focus {
    outline: none;
}

.text-editor-page h1 { font-size: 20pt; margin: 0.4em 0; font-weight: 700; }
.text-editor-page h2 { font-size: 16pt; margin: 0.4em 0; font-weight: 700; }
.text-editor-page h3 { font-size: 14pt; margin: 0.35em 0; font-weight: 700; }
.text-editor-page h4,
.text-editor-page h5,
.text-editor-page h6 { font-size: 12pt; margin: 0.3em 0; font-weight: 700; }
.text-editor-page p { margin: 0 0 0.5em; }
.text-editor-page blockquote {
    margin: 0.5em 0;
    padding: 0.25em 0 0.25em 1em;
    border-left: 3px solid #dadce0;
    color: #5f6368;
}
.text-editor-page pre {
    background: #f1f3f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10pt;
}
.text-editor-page img {
    max-width: 100%;
    height: auto;
}
.text-editor-page a {
    color: #1a73e8;
}

.text-editor-code {
    background: #fff;
}

.text-editor-plain {
    flex: 1;
    border: none;
    resize: none;
    outline: none;
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    background: #fdfdfd;
    color: #202124;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.text-meta {
    padding: 8px 16px;
    border-top: 1px solid #dadce0;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #5f6368;
    background: #f8f9fa;
    min-height: 32px;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .text-editor-scroll {
        padding: 12px 8px 24px;
    }
    .text-editor-page {
        min-height: auto;
        padding: 24px 20px;
        width: 100%;
        box-shadow: none;
    }
    .tool-select {
        max-width: 110px;
    }
}

/* ── PDF Viewer ── */
.pdf-wrap {
    height: calc(100% - 56px);
    display: grid;
    grid-template-rows: 50px 1fr;
}

.pdf-toolbar {
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 8px;
    background: #fff;
}

.pdf-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
}

.pdf-thumbs {
    border-right: 1px solid #dadce0;
    overflow: auto;
    padding: 8px;
    background: #f8f9fa;
}

.pdf-thumbs button {
    width: 100%;
    height: 36px;
    margin-bottom: 6px;
    border: 1px solid #dadce0;
    background: #fff;
    color: #202124;
    border-radius: 4px;
    cursor: pointer;
}

.pdf-view {
    grid-column: 1 / -1;
    width: 100%;
    height: 100%;
    min-width: 0;
    border: none;
    background: #fff;
}

/* ── Spreadsheet ── */
.sheet-wrap {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto 34px minmax(0, 1fr) 40px;
    background: #fff;
    color: #202124;
}

.sheet-toolbar {
    min-height: 44px;
    padding: 6px 12px;
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    gap: 2px;
    background: #e6f4ea;
}

.sheet-toolbar .tool-btn-icon {
    border: none;
    background: transparent;
}

.sheet-toolbar .tool-btn-icon:hover {
    background: #cce8d4;
}

.sheet-search-wrap {
    height: 32px;
    width: min(260px, 40vw);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #c4c7c5;
}

.sheet-search-wrap .material-icons-outlined {
    font-size: 18px;
    color: #5f6368;
}

.sheet-search-wrap input {
    min-width: 0;
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #202124;
    font-size: 13px;
}

.sheet-formula-bar {
    min-height: 34px;
    display: grid;
    grid-template-columns: 72px 34px minmax(0, 1fr);
    align-items: center;
    border-bottom: 1px solid #dadce0;
    background: #fff;
}

.sheet-cell-address {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #dadce0;
    font-size: 12px;
    color: #3c4043;
}

.sheet-fx {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 15px;
    font-style: italic;
    color: #5f6368;
}

#sheet-formula-input {
    height: 100%;
    min-width: 0;
    border: none;
    border-left: 1px solid #dadce0;
    outline: none;
    padding: 0 10px;
    color: #202124;
    background: #fff;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.sheet-body {
    overflow: auto;
    padding: 0;
    background: #fff;
}

.sheet-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
    border-right: 1px solid #dadce0;
    border-bottom: 1px solid #dadce0;
    min-width: 110px;
    width: 110px;
    height: 28px;
    padding: 4px 6px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f9fa;
    color: #5f6368;
    text-align: center;
    font-weight: 500;
}

.sheet-table .sheet-corner {
    left: 0;
    z-index: 5;
    min-width: 46px;
    width: 46px;
}

.sheet-table .sheet-row-number {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 46px;
    width: 46px;
    background: #f8f9fa;
    color: #5f6368;
    text-align: center;
    font-weight: 400;
}

.sheet-table td {
    background: #fff;
    color: #202124;
    cursor: cell;
    outline: none;
}

.sheet-table td.active,
.sheet-table td[contenteditable='true']:focus {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 2px #1a73e8;
    overflow: visible;
}

.sheet-tabs-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-top: 1px solid #dadce0;
    background: #f8f9fa;
    overflow-x: auto;
}

.sheet-tab {
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #3c4043;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
}

.sheet-tab .material-icons-outlined {
    font-size: 16px;
    color: #188038;
}

.sheet-tab:hover {
    background: #e8eaed;
}

.sheet-tab.active {
    background: #ceead6;
    color: #137333;
    font-weight: 600;
}

/* ── Video Player (Google Drive style) ── */
.video-wrap {
    height: calc(100% - 56px);
    background: #000;
    overflow: hidden;
}

.video-cinema {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    cursor: pointer;
    user-select: none;
}

.video-el {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.video-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: auto;
    transition: opacity .18s, transform .18s;
}

.video-center-play.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-center-play svg { width: 36px; height: 36px; }

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
}

.video-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.video-overlay-top {
    background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, transparent 100%);
    padding: 12px 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-title-label {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 52px);
}

.video-overlay-bottom {
    background: linear-gradient(0deg, rgba(0,0,0,.82) 0%, transparent 100%);
    padding: 28px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-seekbar-wrap {
    position: relative;
    height: 18px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    cursor: pointer;
}

.video-seekbar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.3);
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    accent-color: #1a73e8;
    transition: height .15s;
}

.video-seekbar-wrap:hover .video-seekbar { height: 6px; }

.video-seekbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    cursor: pointer;
}

.video-buffered {
    position: absolute;
    left: 4px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.4);
    pointer-events: none;
    z-index: 1;
    transition: width .3s;
}

.video-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-controls-left,
.video-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background .15s;
    flex-shrink: 0;
}

.video-icon-btn:hover { background: rgba(255,255,255,.15); }
.video-icon-btn svg { width: 20px; height: 20px; display: block; }

.video-vol-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.video-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 72px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,.3);
    accent-color: #fff;
    cursor: pointer;
    outline: none;
}

.video-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.video-time-label {
    font-size: 12px;
    color: rgba(255,255,255,.9);
    font-family: 'Roboto Mono', monospace, sans-serif;
    white-space: nowrap;
    padding: 0 6px;
}

.video-speed-sel {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    padding: 4px 6px;
    cursor: pointer;
    outline: none;
}

.video-speed-sel option { background: #202124; color: #fff; }

/* ── Details Panel Properties ── */
.details-section-title {
    margin: 16px 24px 16px 24px;
    font-size: 18px;
    font-weight: 500;
    color: #202124;
}

.property-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 24px;
    gap: 16px;
}

.property-icon {
    display: flex;
    color: #5f6368;
    margin-top: 2px;
    margin-right: 16px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.property-icon svg {
    width: 24px;
    height: 24px;
}

.property-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.property-label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 4px;
}

.property-value {
    font-size: 14px;
    color: #202124;
    word-break: break-word;
    line-height: 1.5;
}

.property-value a { color: #1a73e8; text-decoration: none; }
.property-value a:hover { text-decoration: underline; }

.panel-sep {
    height: 1px;
    background: #e0e0e0;
    margin: 16px 0;
}

#details-description {
    width: 100%;
    min-height: 80px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: #f8f9fa;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
    margin-top: 4px;
}

#details-description:focus {
    outline: none;
    border-color: #1a73e8;
    background: #fff;
    box-shadow: inset 0 0 0 1px #1a73e8;
}

/* ── Details Panel Actions (4 buttons: Share, Download, Rename, Delete) ── */
.details-actions-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px;
    border-bottom: none;
}

.details-action-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 11px;
    background: #fff;
    cursor: pointer;
    color: #5f6368;
    gap: 6px;
    transition: background 0.15s;
}

.details-action-btn:hover {
    background: #f8f9fa;
}

.details-action-btn svg {
    width: 18px;
    height: 18px;
    fill: #5f6368;
}

/* ── Details Panel Access Section ── */
.m3-details-access {
    margin: 0 16px 12px;
    border: 1px solid #e0e3e7;
    border-radius: 12px;
    background: #fbfcff;
    padding: 12px;
}

.m3-manage-access-btn {
    height: 36px;
    border-radius: 18px;
    border: 1px solid #c6dafc;
    color: #1a73e8;
    background: #ecf3fe;
    font-weight: 500;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
}

.m3-manage-access-btn:hover {
    background: #e2eeff;
}

.m3-details-tabs .tab-btn {
    height: 36px;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .editor-shell {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    .editor-toolbar {
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 8px 10px;
    }
    .editor-controls {
        width: 100%;
        order: 2;
    }
    .image-editor-body {
        flex-direction: column;
    }
    .image-panel {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid #dadce0;
        box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    }
    .sheet-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .sheet-search-wrap {
        min-width: 150px;
    }
    .sheet-table th,
    .sheet-table td {
        min-width: 96px;
        width: 96px;
    }
    .sheet-table .sheet-corner,
    .sheet-table .sheet-row-number {
        min-width: 40px;
        width: 40px;
    }
    .shortcuts-grid { grid-template-columns: repeat(2, 1fr); }
    .pdf-content { grid-template-columns: 1fr; }
    .pdf-thumbs { display: none; }
}

@media (max-width: 560px) {
    .open-with-recommended {
        display: none;
    }
    .open-with-modal .modal-header,
    .open-with-apps {
        padding-left: 16px;
        padding-right: 16px;
    }
}
