/* temp/web/wrvr.css */
#river-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box; }
.wiki-card {
    background-color: white;
    border: none; 
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px 25px;
    box-sizing: border-box;
    transition: box-shadow 0.2s;}
.wiki-card:hover .control-button {opacity: 1;}
.wiki-card.is-editing .card-state-button { background-color: #28a745; }
.wiki-card:hover {box-shadow: 0 4px 15px rgba(0,0,0,0.1);}
.wiki-tabs-container {border: 1px solid #ddd; border-radius: 4px; overflow-x: auto; margin: 15px 0;}
.wiki-tabs-header { 
    background: #f9f9f9; 
    border-bottom: 1px solid #ddd; 
    display: flex; 
    flex-wrap: wrap;
    overflow-x: visible;}
.wiki-tabs-container.mode-vertical { display: flex; min-height: 200px; }
.wiki-tabs-sidebar {
    width: 120px; background: #f4f4f4; border-right: 1px solid #ddd;
    display: flex; flex-direction: column; flex-shrink: 0;}
.wiki-tab-content { flex-grow: 1; min-width: 0; padding: 20px; background: #fff; }
.wiki-nested-body { display: flex; min-height: 300px; }
.tab-btn {
    padding: 6px 10px;
    border: none; background: transparent; cursor: pointer;
    border-right: 1px solid #eee; 
    border-bottom: 1px solid transparent;
    white-space: nowrap;
    font-size: 0.9rem;
    flex-grow: 0;}
.tab-btn:hover { background: #eee; }
.tab-btn.active { background: #fff; font-weight: bold; border-bottom: 2px solid #2ecc71; }
.tab-btn-v {
    padding: 8px 12px; text-align: left; border: none; background: transparent; cursor: pointer;
    border-bottom: 1px solid #eee;}
.tab-btn-v:hover { background: #e9e9e9; }
.tab-btn-v.active { background: #fff; font-weight: bold; border-left: 4px solid #2ecc71; }
.nested-sidebar { width: 180px; background: #fafafa; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0; 
    padding: 0 0 10px 0;
    background: transparent;
    height: auto;
    position: static;
    z-index: auto;}
.card-title-view {
    margin: 0;
    font-size: 1.5em;
    color: #222;
    font-weight: 700;
    line-height: 1.3;}
.card-controls {display: flex; gap: 8px; margin-left: auto; flex-shrink: 0;}
.card-state-button { background-color: #ffc107; }
.card-close-button { background-color: #ff5f57; }
.card-tags-view {display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px;}
.card-content-view { font-size: 1.05em; line-height: 1.6; color: #333;}
.card-content-view p { margin-top: 0; margin-bottom: 10px; }
.card-content-view iframe,
.card-content-view video,
.card-content-view embed,
.card-content-view object {
    max-width: 100%;
    width: 100% !important; 
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 10px 0;}
.card-content-view img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);}
.card-title-icon {width: 24px; height: 24px; object-fit: contain; vertical-align: middle;}
.card-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;}
.card-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    vertical-align: middle;}
.card-icon-wrapper svg {width: 100%; height: 100%; fill: currentColor;}
.card-content-view pre {
    background-color: #f5f7f9;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    line-height: 1.45;
    color: #24292e;}
.card-footer {
    font-size: 0.75em;
    color: #bbb;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    text-align: right;
    font-family: monospace;}
.card-editor-ui {display: flex; flex-direction: column; gap: 15px;}
.control-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, opacity 0.2s;
    opacity: 0.3;}
.toolbar-btn {
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    color: #444;}
.toolbar-btn:hover { background-color: #fff; border-color: #aaa; }
.editor-input-field {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #ddd;
    font-size: 1.3em;
    font-weight: bold;
    outline: none;
    font-family: inherit;
    background: transparent;}
.editor-input-field:focus { border-bottom-color: #28a745; }
.editor-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px; 
    padding: 8px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    background-color: #f8f9fa;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #eee;}
.editor-content-area {
    min-height: 200px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    outline: none;
    line-height: 1.6;
    font-size: 1em;}
.editor-content-area:focus { border-color: #ccc; }
.editor-tags-wrapper {position: relative; margin-bottom: 10px;}
.editor-extra-fields {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #eee;}
.type-selector {
    margin-left: auto;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.8em;}
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;}
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;}
.autocomplete-item:last-child {border-bottom: none;}
.autocomplete-item:hover {background-color: #eef6fc; color: #000;}
.settings-form-container {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;}
.settings-group {display: flex; flex-direction: column; gap: 6px;}
.settings-group label {font-weight: 600; font-size: 0.9rem; color: #444;}
.settings-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;}
.settings-group input:focus {border-color: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1); outline: none;}
.settings-actions {
    display: flex;
    justify-content: flex-end; /* Кнопки справа */
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;}
.btn-settings-save {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;}
.btn-settings-save:hover { background-color: #218838; }
.btn-settings-cancel {
    background-color: white;
    color: #555;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;}
.btn-settings-cancel:hover { background-color: #f8f9fa; }
.btn-add-field {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;}
.btn-add-field:hover { background-color: #f0fff4; border-color: #28a745; }
.editor-toolbar {justify-content: flex-start;  padding: 8px 10px; background-color: #f9f9f9;}
.editor-extra-fields {margin-top: 15px; padding-top: 15px; border-top: 1px dashed #eee;}
.extra-fields-label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;}
.extra-fields-row { display: flex; gap: 10px; align-items: center;}
.extra-field-key {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 0.9em;
    color: #555;
    background: #fdfdfd;}
.extra-field-value {
    flex: 2;
    padding: 6px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;}
@media (max-width: 600px) {
    .card-content-view iframe {border-radius: 4px;} }