.chip {
    padding: 1px 7px;
    margin-left: 10px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-1);
    color: var(--ink-2);
    font-size: var(--step--1);
    font-style: normal;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: 1px;
    white-space: nowrap;
}

.chat-attach-drop:has(input:focus-visible) {
    outline: var(--focus-ring);
    outline-offset: 3px;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

:is(.files-page, .uploads-page, .shares-page, .share-page) {
    position: relative;
}

:is(.files-page, .uploads-page, .shares-page, .share-page) .form-notice {
    margin: 0 0 12px;
    color: var(--alert-soft);
    font-size: var(--step-0);
    text-align: left;
}

.stash-wrap {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
}

.stash-main {
    min-width: 0;
    padding-left: clamp(24px, 3vw, 40px);
    border-left: 1px solid var(--hairline);
}

.stash-tree {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    padding-right: 20px;
    user-select: none;
}

.tree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 6px;
    padding-left: 8px;
}

.tree-title {
    margin: 0;
    color: var(--ink-2);
    font-size: var(--step-0);
    font-weight: 700;
}

.tree-add {
    width: 36px;
    height: 36px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 40px;
    padding: 0 4px;
    border-radius: var(--r-2);
    transition: background-color 0.15s ease;
}

.tree-node:hover {
    background: var(--wash);
}

.tree-here,
.tree-here:hover {
    background: var(--wash-strong);
}

.tree-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 36px;
    color: var(--ink-2);
    font-size: var(--step-0);
    text-decoration: none;
}

.tree-link:hover {
    color: var(--ink);
}

.tree-here .tree-link {
    color: var(--ink);
    font-weight: 600;
}

.tree-ico {
    display: inline-flex;
    flex: none;
    color: rgb(var(--sun-rgb));
}

.tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--r-1);
    background: none;
    color: var(--ink-3);
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), color 0.15s ease;
}

.tree-caret:hover {
    color: var(--ink);
}

.tree-caret-open {
    transform: rotate(90deg);
}

.tree-caret-slot {
    flex: none;
    width: 24px;
}

.tree-kids {
    margin: 0 0 0 16px;
    padding: 0 0 0 6px;
    border-left: 1px solid var(--hairline);
    list-style: none;
}

.tree-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--r-1);
    background: none;
    color: var(--ink-3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.tree-node:hover .tree-del,
.tree-del:focus-visible {
    opacity: 1;
}

.tree-del:hover {
    color: var(--alert-soft);
}

.tree-del svg {
    width: 14px;
    height: 14px;
}

.tree-empty {
    margin: 10px 8px;
    color: var(--ink-3);
    font-size: var(--step--1);
    line-height: 1.5;
}

.tree-new {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 2px 8px;
}

.tree-new-input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 6px 2px;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: var(--step-0);
    transition: border-color 0.2s ease;
}

.tree-new-input::placeholder {
    color: var(--ink-3);
}

.tree-new-input:focus {
    outline: none;
    border-bottom-color: rgb(var(--sun-rgb));
    box-shadow: 0 1px 0 rgb(var(--sun-rgb));
}

.tree-new-go {
    width: 36px;
    height: 36px;
}

.tree-new-hint {
    margin: 0 0 12px 8px;
    color: var(--ink-3);
    font-size: var(--step--1);
}

.stash-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    min-height: 44px;
    margin: 0 0 14px;
}

.stash-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
    font-size: var(--step-0);
}

.stash-crumbs a {
    color: var(--ink-2);
}

.stash-crumbs a:hover {
    color: var(--ink);
}

.stash-crumbs a.crumb-here {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.crumb-sep {
    display: inline-flex;
    color: var(--ink-3);
}

.stash-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.sel-bar {
    position: sticky;
    top: calc(var(--nav-h) + 8px);
    z-index: 6;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 12px;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--hairline);
    border-top-color: rgb(var(--sun-rgb) / 0.32);
    border-radius: var(--r-3);
    background: rgb(var(--deep-rgb) / 0.97);
    box-shadow: var(--shadow-2);
}

.sel-count {
    font-size: var(--step-0);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sel-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-left: auto;
}

.sel-actions .btn-ghost {
    border-color: transparent;
}

.sel-actions .btn-ghost:hover {
    border-color: var(--hairline);
}

.stash-list-head,
.stash-row {
    display: grid;
    grid-template-columns: 22px 44px minmax(0, 1fr) 84px 108px 136px;
    align-items: center;
    column-gap: 14px;
}

.stash-list-head {
    min-height: 40px;
    padding: 0 8px;
    border-bottom: 1px solid var(--hairline);
}

.stash-col-label {
    color: var(--ink-3);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stash-col-num {
    text-align: right;
}

.stash-facts {
    display: contents;
}

.stash-row {
    position: relative;
    min-height: 66px;
    padding: 8px;
    border-bottom: 1px solid var(--hairline);
    user-select: none;
    transition: background-color 0.15s ease;
}

.stash-row:hover {
    background: var(--wash);
}

.stash-row-sel,
.stash-row-sel:hover {
    background: var(--wash-strong);
}

.stash-row-raised {
    z-index: 60;
}

.stash-row input {
    user-select: text;
}

.stash-row-folder {
    min-height: 54px;
}

.stash-group-gap {
    height: 18px;
}

.stash-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.stash-name {
    min-width: 0;
    overflow: hidden;
    font-size: var(--step-1);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stash-folder {
    color: var(--ink);
    text-decoration: none;
}

.stash-folder:hover {
    text-decoration: underline;
    text-decoration-color: rgb(var(--sun-rgb) / 0.55);
}

.vault-mark {
    display: inline-flex;
    flex: none;
    color: rgb(var(--sun-rgb));
}

.stash-grabs {
    flex: none;
    color: var(--ink-3);
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stash-size,
.stash-date {
    color: var(--ink-2);
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.stash-date {
    color: var(--ink-3);
}

.stash-row-sel .stash-date,
.stash-row-sel .stash-grabs {
    color: var(--ink-2);
}

.stash-row .row-actions {
    flex-wrap: nowrap;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.stash-row:hover .row-actions,
.stash-row:focus-within .row-actions,
.stash-row-raised .row-actions,
.stash-row-open .row-actions,
.stash-row .row-actions-on {
    opacity: 1;
}

@media (hover: none) {
    .stash-row .row-actions {
        opacity: 1;
    }
}

.stash-inline {
    display: flex;
    grid-column: 3 / -1;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stash-input {
    flex: 1;
    min-width: 120px;
    min-height: 40px;
    padding: 6px 2px;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: var(--step-0);
}

.stash-input:focus {
    outline: none;
    border-bottom-color: rgb(var(--sun-rgb));
    box-shadow: 0 1px 0 rgb(var(--sun-rgb));
}

.sel-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-1);
    background: none;
    color: var(--ink-deep);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sel-box:hover {
    border-color: rgb(var(--sun-rgb) / 0.85);
}

.sel-box-on,
.sel-box-on:hover {
    border-color: var(--ink);
    background: var(--ink);
}

.sel-box svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.ficon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    color: var(--ink-2);
}

.ficon svg {
    display: block;
}

.ficon-folder {
    color: rgb(var(--sun-rgb));
}

.stash-row > .ficon {
    position: relative;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: var(--r-1);
}

.stash-row > .ficon svg {
    width: 28px;
    height: 28px;
}

.stash-row-folder > .ficon svg {
    width: 30px;
    height: 30px;
}

.ficon-thumb {
    background: rgb(var(--deep-rgb) / 0.35);
}

.ficon-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drag-ghost {
    opacity: 0.4;
}

[data-drop].drop-hot {
    background: var(--wash-strong);
    outline: 1px dashed rgb(var(--sun-rgb) / 0.75);
    outline-offset: -2px;
}

.stash-empty {
    display: grid;
    justify-items: start;
    gap: 6px;
    margin: 0;
    padding: 40px 8px 24px;
    color: var(--ink-2);
    font-size: var(--step-0);
}

.stash-empty-ico {
    display: inline-flex;
    margin-bottom: 10px;
    color: rgb(var(--sun-rgb));
}

.stash-empty-ico svg {
    width: 26px;
    height: 26px;
}

.stash-empty-line {
    margin: 0;
    color: var(--ink);
    font-size: var(--step-2);
    font-weight: 700;
}

.stash-empty-hint {
    margin: 0;
}

.stash-drawer {
    margin: 10px 0 16px;
    padding: 18px 20px 20px;
}

.stash-drawer-preview {
    padding: 0;
    overflow: hidden;
    isolation: isolate;
}

.stash-drawer-preview .preview-media {
    position: relative;
    z-index: 1;
    transform: translateZ(0);
}

.drawer-title {
    margin: 0 0 14px;
    color: var(--ink-2);
    font-size: var(--step-0);
}

.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -8px -8px 6px 0;
}

.drawer-top .drawer-title {
    margin: 0;
}

.drawer-line {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.drawer-field {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.drawer-field-wide {
    flex: 1 1 300px;
}

.drawer-field > span {
    color: var(--ink-2);
    font-size: var(--step--1);
    font-weight: 600;
}

.drawer-field input {
    width: 100%;
    min-height: 40px;
    padding: 6px 2px;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: var(--step-0);
    transition: border-color 0.2s ease;
}

.drawer-field input::placeholder {
    color: var(--ink-3);
}

.drawer-field input:hover {
    border-bottom-color: rgb(var(--sun-rgb) / 0.75);
}

.drawer-field input:focus {
    outline: none;
    border-bottom-color: rgb(var(--sun-rgb));
    box-shadow: 0 1px 0 rgb(var(--sun-rgb));
}

.drawer-targets {
    display: flex;
    flex-direction: column;
    max-height: 288px;
    margin: 0 -8px;
    overflow-y: auto;
}

.drawer-target {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-2);
    background: none;
    color: var(--ink);
    font-size: var(--step-0);
    text-align: left;
    cursor: pointer;
}

.drawer-target svg {
    flex: none;
    color: rgb(var(--sun-rgb));
}

.drawer-target:hover {
    background: var(--wash-strong);
}

.drawer-note {
    margin: 0;
    padding: 0 8px;
    color: var(--ink-3);
    font-size: var(--step-0);
}

.share-code {
    flex: 1 1 280px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-2);
    background: rgb(var(--deep-rgb) / 0.5);
    color: var(--ink);
    font-size: var(--step--1);
    overflow-wrap: anywhere;
    user-select: all;
}

.row-menu-wrap {
    position: relative;
    display: inline-flex;
}

.row-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--hairline);
    border-top-color: rgb(var(--sun-rgb) / 0.32);
    border-radius: var(--r-3);
    background: rgb(var(--deep-rgb) / 0.97);
    box-shadow: var(--shadow-2);
    animation: menu-in 0.18s var(--ease-out);
}

.row-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-2);
    background: none;
    color: var(--ink);
    font-size: var(--step-0);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.row-menu-item svg {
    flex: none;
    color: var(--ink-2);
}

.row-menu-item:hover,
.row-menu-item:focus-visible {
    background: var(--wash-strong);
}

.row-menu-danger,
.row-menu-danger svg {
    color: var(--alert-soft);
}

.row-menu-danger:hover,
.row-menu-danger:focus-visible {
    background: rgb(var(--alert-rgb) / 0.12);
}

.row-menu-veil,
.row-menu-sheet-head {
    display: none;
}

.links-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 0 0 10px;
}

.links-sum {
    margin: 0;
    color: var(--ink-2);
    font-size: var(--step-0);
}

.links-sum .num {
    color: var(--ink);
    font-weight: 700;
}

.links-sum-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    margin: 0 12px;
    background: var(--hairline-strong);
    vertical-align: -2px;
}

.links-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.links-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--hairline);
    list-style: none;
}

.link-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) minmax(170px, auto) auto;
    align-items: center;
    column-gap: 20px;
    min-height: 92px;
    padding: 16px 8px;
    border-bottom: 1px solid var(--hairline);
    transition: background-color 0.15s ease;
}

.link-row:hover {
    background: var(--wash);
}

.link-row > .ficon svg {
    width: 28px;
    height: 28px;
}

.link-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.link-name {
    overflow: hidden;
    color: var(--ink);
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.link-name:hover {
    text-decoration: underline;
    text-decoration-color: rgb(var(--sun-rgb) / 0.55);
}

.link-facts {
    color: var(--ink-3);
    font-size: var(--step--1);
    line-height: 1.5;
}

.link-sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 9px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
}

.link-gone {
    color: var(--alert-soft);
}

.link-state {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ink);
    font-size: var(--step-0);
    font-weight: 600;
    white-space: nowrap;
}

.link-count {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-stretch: 112%;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.link-row-closed .link-name,
.link-row-closed .link-state,
.link-row-closed .ficon {
    color: var(--ink-3);
}

.link-row-closed .link-state {
    font-weight: 400;
}

.link-acts {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.link-row:hover .link-acts,
.link-row:focus-within .link-acts {
    opacity: 1;
}

@media (hover: none) {
    .link-acts {
        opacity: 1;
    }
}

.links-empty {
    display: grid;
    justify-items: start;
    gap: 8px;
    max-width: 56ch;
    padding: 8px 0 24px;
}

.links-empty-line {
    margin: 0;
    font-size: var(--step-2);
    font-weight: 700;
}

.links-empty-hint {
    margin: 0 0 14px;
    color: var(--ink-2);
}

@media (max-width: 940px) {
    .stash-wrap {
        grid-template-columns: minmax(0, 1fr);
    }

    .stash-main {
        padding-left: 0;
        border-left: 0;
    }

    .stash-tree {
        position: static;
        margin: 0 0 20px;
        padding: 0 0 12px;
        border-bottom: 1px solid var(--hairline);
    }

    .tree-head {
        padding-left: 4px;
    }
}

@media (max-width: 760px) {
    .stash-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .stash-tools {
        margin-left: 0;
    }

    .stash-list-head {
        display: none;
    }

    .stash-row {
        grid-template-columns: 22px 44px minmax(0, 1fr) auto;
        column-gap: 12px;
        row-gap: 2px;
        min-height: 68px;
        padding: 10px 4px;
    }

    .stash-row > .sel-box,
    .stash-row > .ficon {
        grid-row: 1 / 3;
    }

    .stash-name-wrap {
        grid-column: 3;
        grid-row: 1;
    }

    .stash-name {
        font-size: var(--step-0);
    }

    .stash-facts {
        display: flex;
        grid-column: 3;
        grid-row: 2;
        gap: 10px;
    }

    .stash-size,
    .stash-date {
        text-align: left;
    }

    .stash-row .row-actions {
        grid-column: 4;
        grid-row: 1 / 3;
    }

    .stash-row .row-peek {
        display: none;
    }

    .stash-inline {
        grid-column: 3 / -1;
        grid-row: 1 / 3;
    }

    .stash-drawer {
        padding: 16px;
    }

    .row-menu {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 80;
        min-width: 0;
        padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
        border-bottom: 0;
        border-radius: var(--r-3) var(--r-3) 0 0;
        animation: sheet-up 0.24s var(--ease-out);
    }

    .row-menu-item {
        min-height: 48px;
        font-size: var(--step-1);
    }

    .row-menu-veil {
        position: fixed;
        inset: 0;
        z-index: 75;
        display: block;
        background: rgb(var(--deep-rgb) / 0.62);
    }

    .row-menu-sheet-head {
        display: block;
        margin: 0 0 8px;
        padding: 4px 12px 12px;
        overflow: hidden;
        border-bottom: 1px solid var(--hairline);
        color: var(--ink-2);
        font-size: var(--step-0);
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-row {
        grid-template-columns: 28px minmax(0, 1fr);
        align-items: start;
        row-gap: 10px;
        min-height: 0;
        padding: 16px 4px;
    }

    .link-row > .ficon {
        padding-top: 2px;
    }

    .link-name {
        font-size: var(--step-1);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .link-state,
    .link-acts {
        grid-column: 2;
    }

    .link-acts {
        justify-content: flex-start;
        opacity: 1;
    }
}
