/*====================================================================
  filestore.css  ファイルポケットとファイルバンクの画面(共通)
  2026/11/14 新規。filepocket.html の中にあったものを移し、外部向けリンクの見た目を足した。
  body に padding を書かないこと(sidebar.js の寄せを打ち消すため)
====================================================================*/
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #222;
}
/* body に padding を書かないこと(sidebar.js の寄せを打ち消すため) */
header {
    background-color: var(--theme-main);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 20px;
}
header h1 {
    font-size: 1.5em;
    margin-left: 5px;
}
main {
    padding: 16px 18px;
}
.wrap {
    max-width: 1200px;
    margin: 0 auto;
}
.msg {
    text-align: center;
    color: #777;
    padding: 40px 20px;
    font-size: 0.95em;
}

/* 上の段: 使用量 */
.top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.top-title {
    font-size: 0.9em;
    color: #555;
}
.usage {
    min-width: 240px;
    font-size: 0.82em;
    color: #555;
}
.usage-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.usage-line b {
    color: #222;
    font-size: 1.1em;
}
.meter {
    height: 8px;
    background-color: #e6e6e6;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0 3px 0;
    display: flex;
}
.meter-pocket { background-color: var(--theme-main); height: 100%; }
.meter-bank   { background-color: var(--theme-main); opacity: 0.45; height: 100%; }
.meter.warn .meter-pocket, .meter.warn .meter-bank { background-color: #e0a100; }
.meter.full .meter-pocket, .meter.full .meter-bank { background-color: #d9534f; }

/* 注意の帯 */
.warn-box {
    margin: 0 0 14px 0;
    padding: 9px 12px;
    font-size: 0.85em;
    line-height: 1.6;
    color: #6b4e00;
    background-color: #fff8e1;
    border: 1px solid #f0d48a;
    border-radius: 5px;
}

/* 左右の2枚 */
.panes {
    display: flex;
    gap: 14px;
    align-items: stretch;
}
.pane {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.tree-pane {
    flex: 0 0 250px;
    padding: 10px 6px;
    box-sizing: border-box;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}
.list-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pane-caption {
    font-size: 0.78em;
    color: #777;
    padding: 0 8px 6px 8px;
}

/* ツリー */
.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    border-radius: 6px;
    padding-right: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9em;
    white-space: nowrap;
}
.tree-row:hover { background-color: #f2f5f3; }
.tree-row.sel {
    background-color: #cce5ff;    /* PlusWeb の「選択」の色 */
    font-weight: bold;
}
.tree-row.drop-target { outline: 2px solid var(--theme-main); }
.tree-tog {
    width: 20px;
    height: 24px;
    flex: 0 0 20px;
    border: 0;
    background: transparent;
    color: #777;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}
.tree-tog.none { visibility: hidden; }
.tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.ico-folder {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}
.tree-scroll {
    flex: 1;
    overflow: auto;
}
.tree-trash {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 6px;
}
.tree-trash .tree-row { color: #555; padding-left: 8px; }
.tree-trash .note { font-size: 0.78em; color: #999; padding: 2px 10px 0 34px; }
.top-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trash-link {
    font-size: 0.85em;
    color: var(--theme-text);
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 3px 10px;
    background-color: white;
}
.trash-link:hover { background-color: var(--theme-light); }
.left-soon { color: #c62828; }
.search-box {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 240px;
    max-width: 100%;
}
.search-box .overwrite-wrap { flex: 1; }
.search-box input[type="text"] { height: 34px; font-size: 0.88em; }
.btn-clear {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
}
.btn-clear:hover { background-color: #eee; }
.loc-line {
    font-size: 0.78em;
    color: #777;
    margin-top: 2px;
}
.loc-line a, .loc-cell a { color: var(--theme-text); text-decoration: none; }
.loc-line a:hover, .loc-cell a:hover { text-decoration: underline; }
.loc-line { display: none; }          /* PC では「場所」の列に出すので、名前の下には出さない */
td.loc-cell {
    white-space: normal;
    font-size: 0.85em;
    min-width: 140px;
    max-width: 260px;
    line-height: 1.4;
}
@media (max-width: 760px) {
    .search-box { width: 100%; order: 10; }
    .loc-line { display: block; }    /* スマホは列を出さないので、名前の下に場所を出す */
}
.place-gone { color: #999; }

/* 一覧の上の帯 */
.list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}
.crumbs {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 0.92em;
}
.crumbs a {
    color: var(--theme-text);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
}
.crumbs a:hover { background-color: var(--theme-light); }
.crumbs .sep { color: #aaa; }
.crumbs .here { font-weight: bold; padding: 2px 4px; }
.btn-main, .btn-outline {
    padding: 7px 14px;
    font-size: 0.86em;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid var(--theme-main);
}
.btn-main { background-color: var(--theme-main); color: white; }
label.btn-main { display: inline-block; line-height: 1.4; }
.btn-outline { background-color: white; color: var(--theme-main); }
.btn-main:disabled, .btn-outline:disabled {
    border-color: #ccc;
    background-color: #eee;
    color: #999;
    cursor: not-allowed;
}

/* 一覧 */
.list-scroll {
    overflow-x: auto;
}
table.items {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.9em;
}
table.items th {
    text-align: left;
    font-weight: normal;
    font-size: 0.82em;
    color: #777;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
table.items td {
    padding: 0 12px;
    height: 42px;
    border-bottom: 1px solid #f2f2f2;
    white-space: nowrap;
}
table.items tr.row:hover td { background-color: #f7faf8; }
table.items tr.row.sel td { background-color: #cce5ff; }
table.items td.num { text-align: right; color: #666; }
table.items td.sub { color: #666; }
.name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.name-cell .nm {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}
tr.folder .nm { font-weight: bold; cursor: pointer; }
table.searching .name-cell .nm { max-width: 560px; }
/* 検索結果: コメントは名前の下の小さな行。当たった言葉には色 */
.cmt-line {
    font-size: 0.8em;
    color: #777;
    margin-top: 2px;
    max-width: 560px;
    overflow: hidden;
    text-overflow: ellipsis;
}
mark.hit {
    background-color: #fff3a8;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
.comment-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
}
.ext-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    background-color: #eceff1;
    color: #37474f;
}
.btn-dots {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: #666;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.btn-dots:hover { background-color: #e9eeeb; }
.empty {
    text-align: center;
    color: #888;
    font-size: 0.9em;
    padding: 40px 20px;
    line-height: 1.8;
}
.drop-zone {
    margin: 14px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-size: 0.85em;
    color: #888;
}

/* スマホ: ツリーを出さない。ファイル名の下に小さい行 */
.sub-line { display: none; }
@media (max-width: 760px) {
    main { padding: 12px 10px; }
    .tree-pane { display: none; }
    table.items { min-width: 0; }
    table.items th, table.items td.col-wide { display: none; }
    table.items td { height: 56px; }
    .name-cell .nm { max-width: 220px; }
    .sub-line {
        display: block;
        font-size: 0.78em;
        color: #777;
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 240px;
    }
}

/* 操作メニュー(右クリック・⋯) */
.ctx {
    position: fixed;
    z-index: 2600;
    min-width: 210px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.16);
    padding: 5px;
    display: none;
}
.ctx.show { display: block; }
.ctx-head {
    font-size: 0.75em;
    color: #777;
    padding: 6px 10px 6px 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctx button {
    display: block;
    width: 100%;
    height: 36px;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0 10px;
    font-size: 0.9em;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    color: #222;
}
.ctx button:hover { background-color: var(--theme-light); }
.ctx button:disabled { color: #aaa; cursor: not-allowed; background: transparent; }
.ctx .danger { color: #c62828; }
.ctx hr { border: 0; border-top: 1px solid #eee; margin: 4px 0; }

/* 小窓 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
}
.modal-overlay.show { display: flex; }
.modal {
    background-color: white;
    border-radius: 8px;
    padding: 20px 22px;
    max-width: 380px;
    width: 88%;
}
.modal.wide { max-width: 460px; }
.modal h3 {
    font-size: 1.05em;
    margin: 0 0 12px 0;
    color: var(--theme-text);
}
.modal p {
    font-size: 0.95em;
    color: #333;
    line-height: 1.6;
    margin: 0 0 16px 0;
    word-break: break-all;
}
.modal .err {
    color: #c62828;
    font-size: 0.85em;
    min-height: 1.2em;
    margin: 6px 0 0 0;
}
.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.modal-buttons button {
    padding: 8px 16px;
    font-size: 0.95em;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
}
.modal-buttons .no, .modal-buttons .ok {
    border: 2px solid var(--theme-main);
    background-color: var(--theme-main);
    color: white;
}
.modal-buttons .yes, .modal-buttons .cancel {
    border: 2px solid #ccc;
    background-color: white;
    color: #777;
}
#confirm-modal { z-index: 2700; }

.overwrite-wrap { position: relative; }
.overwrite-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    padding: 0 10px;
    font-size: 0.95em;
    background-color: var(--theme-light);
    border: 2px solid var(--theme-main);
    border-radius: 5px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
input[type="text"] {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    font-size: 0.95em;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}
input[type="text"]:focus { outline: none; }

/* 移動先を選ぶツリー */
.pick-tree {
    max-height: 320px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px;
}
.pick-tree .tree-row.disabled {
    color: #bbb;
    cursor: not-allowed;
}

/* ドラッグ中の案内 */
.drop-banner {
    bottom: 24px;
    background-color: #333;
    transition: opacity 0.1s ease, transform 0.1s ease;
}
.drop-zone.over {
    border-color: var(--theme-main);
    background-color: var(--theme-light);
    color: var(--theme-text);
}

/* 送信の進み具合(右下のカード) */
.up-card {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    padding: 12px 14px;
    box-sizing: border-box;
    z-index: 1900;
    display: none;
    font-size: 0.85em;
}
.up-card.show { display: block; }
.up-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    margin-bottom: 6px;
}
.up-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    width: 32px;
    height: 32px;
}
.up-name { word-break: break-all; color: #333; }
.bar { height: 6px; background-color: #e6e6e6; border-radius: 3px; overflow: hidden; margin: 6px 0; }
.bar-fill { height: 100%; width: 0; background-color: var(--theme-main); transition: width 0.3s ease; }
.bar-fill.paused { background-color: #9e9e9e; }
.bar-fill.ng { background-color: #d9534f; }
.up-stats { display: flex; justify-content: space-between; gap: 6px; color: #666; flex-wrap: wrap; }
.up-now { color: #666; margin-top: 4px; min-height: 1.2em; }
.up-now.warn { color: #b26a00; }
.up-now.ng { color: #c62828; }
.stay-notice {
    display: none;
    margin-top: 8px;
    padding: 7px 9px;
    background-color: #fff8e1;
    border: 1px solid #f0d48a;
    border-radius: 5px;
    color: #6b4e00;
    line-height: 1.5;
}
.stay-notice.show { display: block; }
.up-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.up-queue { margin-top: 8px; border-top: 1px solid #eee; padding-top: 6px; }
.q-item { display: flex; gap: 6px; padding: 2px 0; align-items: baseline; }
.q-item .mark { width: 14px; flex: 0 0 14px; color: #888; }
.q-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item .st { color: #888; white-space: nowrap; }
.q-item.sending .mark, .q-item.sending .st { color: var(--theme-text); font-weight: bold; }
.q-item.done .mark { color: var(--theme-text); }
.q-item.failed .mark, .q-item.failed .st { color: #c62828; }
.q-item .why { display: block; color: #c62828; white-space: normal; font-size: 0.92em; }
.q-item.skipped .why { color: #888; }

/* 同じ名前があったときの小窓 */
.conflict-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.conflict-buttons button {
    padding: 10px 14px;
    font-size: 0.95em;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    border: 2px solid #ccc;
    background-color: white;
    color: #333;
}
.conflict-buttons button.primary { border-color: var(--theme-main); color: var(--theme-text); }
.conflict-buttons small { display: block; color: #777; font-size: 0.82em; margin-top: 2px; }
.conflict-all { margin-top: 12px; font-size: 0.88em; color: #555; display: flex; align-items: center; gap: 6px; }

.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255,255,255,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e0e0e0;
    border-top-color: var(--theme-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--theme-main);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 2000;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== メニューの補足 ===== */
.ctx .strong { color: var(--theme-text); font-weight: bold; }
.ctx-note {
    font-size: 0.75em;
    color: #888;
    padding: 4px 10px 6px 10px;
    max-width: 240px;
    line-height: 1.5;
}
.link-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: normal;
    color: var(--theme-text);
    background-color: var(--theme-light);
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ===== 外部向けリンク(ファイルバンクだけ。以前の filebank.html から) ===== */
.file-label {
    font-size: 0.88em;
    color: #555;
    margin-bottom: 14px;
    word-break: break-all;
}
.field-caption {
    font-size: 0.8em;
    color: #777;
    margin: 12px 0 4px 0;
}
.modal select {
    font-family: inherit;
    font-size: 0.95em;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.modal.link-wide {
    max-width: 560px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
}
.note {
    font-size: 0.8em;
    color: #888;
    line-height: 1.6;
}
.copy-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.copy-row input[type="text"] {
    flex: 1;
    background-color: #f7f7f7;
}
.copy-row .btn-outline { flex-shrink: 0; }
.password-box {
    flex: 1;
    font-size: 1.6em;
    font-weight: bold;
    letter-spacing: 0.12em;
    padding: 6px 12px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 5px;
    user-select: all;
}
.mail-text {
    width: 100%;
    height: 150px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.86em;
    line-height: 1.6;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f7f7f7;
    resize: vertical;
}
.link-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background-color: #fafafa;
    border-left: 4px solid var(--theme-main);
}
.link-item.stopped, .link-item.expired { border-left-color: #bbb; }
.link-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-memo { font-size: 0.95em; color: #222; word-break: break-all; }
.state-tag {
    font-size: 0.72em;
    padding: 2px 7px;
    border-radius: 3px;
    white-space: nowrap;
    color: white;
    background-color: var(--theme-main);
}
.state-tag.stopped, .state-tag.expired { background-color: #9e9e9e; }
.link-meta { font-size: 0.78em; color: #888; margin-top: 4px; line-height: 1.6; }
.link-meta .got { color: var(--theme-text); font-weight: bold; }
.row-actions { margin-top: 6px; text-align: right; }
.danger-btn { border-color: #d9534f !important; color: #d9534f !important; padding: 4px 12px !important; }
