
/* ===== ВЕСЬ ТВОЙ CSS ===== */
:root {
    --green-dark: #31583E;
    --green: #4F7755;
    --green-soft: #88A66D;
    --leaf: #A8C77D;
    --cream: #F6F0E4;
    --beige: #E9DEC7;
    --gold: #C8A35A;
    --gold-light: #DFC37B;
    --white: #FFFDF7;
    --text: #2E322B;
    --muted: #687263;
    --danger: #B0473C;
}
* { box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: var(--green-soft) rgba(233,222,199,.5); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(233,222,199,.45); border-radius: 20px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--leaf), var(--green-soft)); border-radius: 20px; border: 2px solid rgba(255,253,247,.8); }
body { margin: 0; height: 100vh; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--text); background: radial-gradient(circle at 80% 15%, rgba(223,195,123,.25), transparent 30%), linear-gradient(135deg, var(--white), var(--cream)); }
.migration-preview-banner { position: fixed; z-index: 9999; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: #fff1c4; color: #492d00; text-align: center; font-weight: 700; box-shadow: 0 -2px 8px #0003; }
.app { height: 100vh; display: grid; grid-template-columns: 440px 1fr; }
.sidebar { background: rgba(255,253,247,.82); backdrop-filter: blur(18px); border-right: 1px solid rgba(200,163,90,.25); padding: 22px; display: flex; flex-direction: column; min-height: 0; }
.logo { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.logo .bot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--leaf), var(--green)); box-shadow: 0 12px 24px rgba(49,88,62,.25); font-size: 24px; }
.logo h1 { margin: 0; font-size: 28px; color: var(--green-dark); }
.logo p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.user-badge { background: rgba(233,222,199,.55); color: var(--green-dark); padding: 9px 13px; border-radius: 999px; font-size: 14px; margin-bottom: 10px; width: fit-content; }
.lock { background: rgba(136,166,109,.15); color: var(--green-dark); padding: 9px 13px; border-radius: 999px; font-size: 13px; margin-bottom: 16px; width: fit-content; }
.btn-row { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 16px; }
.side-btn { width: 100%; border: none; border-radius: 15px; padding: 13px 14px; cursor: pointer; font-weight: 700; text-align: left; color: var(--green-dark); background: rgba(255,253,247,.9); border: 1px solid rgba(200,163,90,.25); transition: .18s ease; }
.side-btn:hover { transform: translateY(-1px); background: var(--cream); border-color: var(--green-soft); }
.side-btn.primary { color: white; background: linear-gradient(135deg, #5B8B63, #31583E); box-shadow: 0 12px 26px rgba(49,88,62,.24); }
.side-btn.restore-button { color: #7A342D; background: rgba(255,253,247,.94); border-color: rgba(176,71,60,.30); }
.side-btn.restore-button:hover { color: #FFFFFF; background: linear-gradient(135deg, #C1695F, #9C3F36); border-color: transparent; }
.side-btn.operation-running, .side-btn:disabled { opacity: .62; cursor: wait; transform: none; box-shadow: none; }
.upload-area { border: 2px dashed rgba(136,166,109,.65); border-radius: 20px; padding: 22px 16px; text-align: center; cursor: pointer; background: rgba(255,253,247,.65); transition: .18s ease; margin-bottom: 14px; color: var(--green-dark); font-weight: 700; }
.upload-area:hover { background: rgba(168,199,125,.18); transform: translateY(-1px); }
.archive-folders { display: grid; gap: 7px; margin: 10px 0 12px; }
.archive-folder { width: 100%; border: 1px solid rgba(200,163,90,.28); border-radius: 13px; padding: 9px 11px; background: rgba(255,253,247,.55); color: var(--green-dark); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; text-align: left; transition: .16s ease; }
.archive-folder:hover { background: rgba(168,199,125,.17); transform: translateX(2px); }
.archive-folder.active { background: rgba(168,199,125,.28); border-color: rgba(88,122,70,.55); box-shadow: 0 5px 14px rgba(65,91,52,.12); }
.archive-folder-count { min-width: 28px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.72); text-align: center; font-size: 12px; }
.search-box { width: 100%; height: 45px; padding: 0 14px; border: 1px solid rgba(200,163,90,.35); border-radius: 15px; outline: none; background: rgba(255,253,247,.95); font-size: 15px; margin-bottom: 12px; }
.search-box:focus { border-color: var(--green-soft); box-shadow: 0 0 0 4px rgba(136,166,109,.16); }
.file-list { flex: 1; overflow-y: auto; padding-right: 4px; min-height: 0; }
.file-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; border-radius: 16px; background: rgba(255,253,247,.72); border: 1px solid rgba(233,222,199,.75); margin-bottom: 8px; transition: .15s ease; }
.file-item:hover { background: var(--white); border-color: var(--green-soft); transform: translateY(-1px); }
.file-info { flex: 1; cursor: pointer; min-width: 0; }
.file-name { font-weight: 700; font-size: 14px; color: var(--green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.file-actions { display: flex; gap: 4px; }
.file-actions button { background: rgba(233,222,199,.45); border: none; cursor: pointer; font-size: 15px; padding: 6px 7px; border-radius: 10px; }
.file-actions button:hover { background: rgba(136,166,109,.22); }
.file-highlight { border: 2px solid var(--green-soft) !important; background: rgba(168,199,125,.22) !important; }
.status { margin-top: 12px; font-size: 12px; color: var(--muted); }
.main { min-width: 0; height: 100vh; padding: 24px; display: flex; flex-direction: column; }
.header { background: linear-gradient(135deg, rgba(255,253,247,.78), rgba(233,222,199,.42)); border: 1px solid rgba(200,163,90,.24); border-radius: 28px; padding: 22px 24px; margin-bottom: 16px; box-shadow: 0 16px 40px rgba(49,88,62,.10); }
.header h1 { margin: 0; font-size: 30px; color: var(--green-dark); }
.header p { margin: 6px 0 0; color: var(--muted); }
.chat-box { flex: 1; min-height: 0; overflow-y: auto; background: rgba(255,253,247,.76); border: 1px solid rgba(200,163,90,.24); border-radius: 28px; padding: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); margin-bottom: 14px; }
.chat-message { margin-bottom: 12px; padding: 12px 16px; border-radius: 20px; max-width: 78%; word-wrap: break-word; line-height: 1.45; font-size: 15px; }
.chat-message.user { background: linear-gradient(135deg, #5B8B63, #31583E); color: white; margin-left: auto; border-bottom-right-radius: 7px; }
.chat-message.bot { background: rgba(233,222,199,.65); color: var(--text); border-bottom-left-radius: 7px; }
.chat-input { display: flex; gap: 10px; background: rgba(255,253,247,.82); border: 1px solid rgba(200,163,90,.24); border-radius: 24px; padding: 10px; }
.chat-input input { flex: 1; border: none; background: transparent; outline: none; padding: 0 10px; font-size: 16px; color: var(--text); }
.chat-input button { width: 54px; height: 46px; border: none; border-radius: 16px; background: linear-gradient(135deg, #5B8B63, #31583E); color: white; cursor: pointer; font-size: 20px; box-shadow: 0 10px 22px rgba(49,88,62,.24); }
.chat-input button:hover { transform: translateY(-1px); }
.modal { display: none; position: fixed; z-index: 1000; inset: 0; background: rgba(46,50,43,.48); backdrop-filter: blur(8px); align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: linear-gradient(135deg, rgba(255,253,247,.96), rgba(246,240,228,.94)); padding: 28px; border-radius: 30px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(49,88,62,.30); border: 1px solid rgba(200,163,90,.32); }
.modal-content h2 { margin-top: 0; color: var(--green-dark); }
.modal-content label { display: block; margin: 12px 0 5px; font-weight: 700; color: var(--green-dark); }
.modal-content input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid rgba(200,163,90,.35); border-radius: 15px; font-size: 15px; background: var(--white); outline: none; }
.modal-content input:focus { border-color: var(--green-soft); box-shadow: 0 0 0 4px rgba(136,166,109,.15); }
.help { font-size: 13px; color: var(--muted); }
.modal-content hr { margin: 20px 0; border: none; border-top: 1px solid rgba(200,163,90,.25); }
.modal-buttons { display: flex; gap: 10px; margin-top: 22px; }
.btn { padding: 13px 18px; border: none; border-radius: 15px; cursor: pointer; font-weight: 800; }
.btn-primary { background: linear-gradient(135deg, #5B8B63, #31583E); color: white; }
.btn-close { background: rgba(233,222,199,.75); color: var(--green-dark); }



/* ===== AT11 КОМПАКТНОЕ ОКНО УСТРОЙСТВ V1-Z.2 ===== */
#peripheralModal .device-modal-content {
    width: min(980px, 96vw);
    max-width: 980px;
    height: min(780px, 92vh);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.device-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 7px;
}
.device-home-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(136,166,109,.18);
}
.device-home-icon svg { width: 22px; height: 22px; }
.device-scan-status {
    min-height: 18px;
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 12px;
}
.device-list-scroll {
    flex: 1;
    min-height: 280px;
    overflow-y: auto;
    padding: 0 6px 8px 0;
}
.device-section {
    margin: 5px 0 10px;
}
.device-section-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    margin: 0;
    border-radius: 10px;
    background: rgba(249,247,239,.97);
    color: var(--green-dark);
    font-size: 16px;
    font-weight: 850;
    backdrop-filter: blur(5px);
    transition: opacity .18s ease, filter .18s ease;
}
.device-section.is-unavailable .device-section-heading {
    opacity: .38;
    filter: grayscale(.75);
}
.device-section-icon {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
}
.device-section-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.device-section-empty {
    padding: 7px 8px 9px;
    color: var(--muted);
    font-size: 12px;
}
.device-section.is-unavailable .device-section-empty {
    opacity: .58;
}
.device-card {
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 7px 6px;
    border-bottom: 1px solid rgba(200,163,90,.18);
}
.device-card:last-child { border-bottom: 0; }
.device-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(233,222,199,.45);
    display: grid;
    place-items: center;
    font-size: 18px;
}
.device-card-name {
    font-weight: 800;
    font-size: 13px;
    line-height: 1.15;
    color: var(--green-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.device-card-state {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.15;
    color: var(--muted);
}
.device-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}
.device-action {
    min-height: 28px;
    border: 0;
    border-radius: 9px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.device-action-connect,
.device-action-remember {
    background: linear-gradient(135deg,#5B8B63,#31583E);
    color: white;
}
.device-action-deny {
    background: rgba(233,222,199,.85);
    color: var(--green-dark);
}
.device-action-delete {
    background: rgba(176,71,60,.13);
    color: #8A352D;
}
.device-action-pair,
.device-action-on,
.device-action-off,
.device-action-youtube,
.device-action-volume,
.device-action-mute,
.device-action-input,
.device-action-app,
.device-action-link,
.device-action-document,
.device-action-rename {
    background: rgba(91,139,99,.16);
    color: var(--green-dark);
}
.device-card-actions {
    align-items: center;
}
.device-card-actions .device-action {
    flex: 0 0 auto;
    width: auto !important;
    height: auto !important;
    max-height: 30px !important;
    min-width: 0 !important;
    margin: 0 !important;
}
.device-modal-footer {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(200,163,90,.22);
}
.device-modal-footer .btn {
    padding: 10px 14px;
}
.device-modal-footer .btn-primary { flex: 1; }

@media (max-width:720px) {
    #peripheralModal .device-modal-content {
        width: 98vw;
        height: 94vh;
        padding: 16px;
    }
    .device-card {
        grid-template-columns: 34px minmax(0,1fr);
    }
    .device-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

.document-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 11px; border-top: 1px solid rgba(49,88,62,.13); }
.document-action-btn { min-height: 32px; padding: 6px 14px; border: 1px solid rgba(49,88,62,.22); border-radius: 15px; background: linear-gradient(135deg, #5B8B63, #31583E); color: #FFFFFF; font-size: 15px; font-weight: 800; cursor: pointer; transition: .18s ease; box-shadow: 0 8px 18px rgba(49,88,62,.18); flex: 1; min-width: 0; text-align: center; }
.document-action-btn:hover { background: linear-gradient(135deg, #66996F, #3A6847); box-shadow: 0 11px 22px rgba(49,88,62,.25); transform: translateY(-1px); }
.document-action-btn.open { color: white; background: linear-gradient(135deg, #5B8B63, #31583E); border-color: transparent; }
.document-action-btn.is-speaking { background: linear-gradient(135deg, #88A66D, #4F7755); }
.document-action-btn:disabled { background: linear-gradient(135deg, rgba(91,139,99,.62), rgba(49,88,62,.62)); color: rgba(255,255,255,.82); opacity: .55; cursor: default; transform: none; box-shadow: none; }
/* AT11_ARCHIVE_LAYOUT_SORT_V1 */
.sidebar { height: 100vh !important; max-height: 100vh !important; overflow: hidden !important; padding: 14px 16px 12px !important; }
.sidebar .logo { margin-bottom: 8px !important; }
.sidebar .logo .bot { width: 42px !important; height: 42px !important; }
.sidebar .logo h1 { font-size: 25px !important; }
.compact-sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin: 6px 0 8px; }
.compact-sidebar-actions .user-badge, .compact-sidebar-actions .lock, .compact-sidebar-actions .side-btn { min-height: 43px; padding: 7px 9px; border-radius: 14px; font-size: 12px; line-height: 1.12; }
.compact-sidebar-actions .compact-icon { font-size: 16px; }
.upload-area { padding: 12px 10px; margin-bottom: 8px; border-radius: 15px; font-size: 14px; }
.search-box { height: 38px; margin-bottom: 6px; padding: 0 11px; border-radius: 12px; font-size: 13px; }
.archive-folders { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 4px 6px !important; margin: 3px 0 6px !important; flex: 0 0 auto !important; }
.archive-folder { min-height: 32px !important; padding: 5px 7px !important; border-radius: 10px !important; gap: 5px !important; font-size: 11px !important; }
.archive-folder-count { min-width: 22px !important; padding: 1px 5px !important; font-size: 10px !important; }
.archive-list-toolbar { flex: 0 0 auto; min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 7px; margin: 2px 0 5px; }
.archive-search-status { min-width: 0; flex: 1 1 auto; min-height: 0 !important; margin: 0 !important; font-size: 11px !important; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-sort-select { flex: 0 0 128px; width: 128px; height: 32px; border: 1px solid rgba(200,163,90,.35); border-radius: 10px; padding: 0 7px; background: rgba(255,253,247,.96); color: var(--green-dark); font-size: 11px; font-weight: 700; outline: none; cursor: pointer; }
.story-filter { flex: 0 0 auto; width: 100%; margin: 3px 0; }
.story-list { display: grid; gap: 5px; margin: 4px 0 10px; font-size: 12px; }
.story-list .story-button { width: 100%; }
#fileList.file-list { display: block !important; visibility: visible !important; opacity: 1 !important; flex: 1 1 auto !important; min-height: 115px !important; max-height: none !important; width: 100% !important; overflow-y: auto !important; overflow-x: hidden !important; margin: 0 !important; padding: 2px 3px 10px 0 !important; box-sizing: border-box !important; }
#fileList .file-item { display: flex !important; width: 100% !important; min-height: 50px !important; padding: 8px !important; margin-bottom: 5px !important; border-radius: 12px !important; flex: 0 0 auto !important; }
#fileList .file-name { font-size: 12px !important; }
#fileList .file-meta { font-size: 10px !important; }
#fileList .file-actions button { padding: 4px 5px !important; font-size: 13px !important; }
.sidebar .status { flex: 0 0 auto; margin-top: 4px !important; font-size: 9px !important; }
@media (max-height: 760px) {
.compact-sidebar-actions .user-badge, .compact-sidebar-actions .lock, .compact-sidebar-actions .side-btn { min-height: 38px !important; padding: 5px 7px !important; }
.upload-area { padding: 9px !important; }
.archive-folder { min-height: 28px !important; padding: 4px 6px !important; }
}
@media (max-width: 820px) {
body { overflow: auto; height: auto; }
.app { height: auto; min-height: 100vh; grid-template-columns: 1fr; }
.sidebar { height: 46vh; border-right: none; border-bottom: 1px solid rgba(200,163,90,.25); }
.main { height: 54vh; padding: 16px; }
.header { padding: 16px; border-radius: 22px; }
.header h1 { font-size: 23px; }
.chat-message { max-width: 92%; }
}
