/* ============================================================
   共有ドライブ(drop.<domain>)の画面
   OS本体(style.css)と同じ配色トークンを持たせて見た目を揃えるが、
   このページは単体で開くので style.css は読み込まない(依存を作らない)。
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --s900: #0f172a; --s800: #1e293b; --s700: #334155; --s500: #64748b;
  --s400: #94a3b8; --s200: #e2e8f0; --s100: #f1f5f9; --s50: #f8fafc;
  --teal: #0d9488; --teal-d: #0f766e; --green: #059669; --red: #dc2626; --amber: #d97706;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  background: var(--s50); color: var(--s800); min-height: 100dvh;
  display: flex; flex-direction: column; -webkit-tap-highlight-color: rgba(0,0,0,.06);
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--s200); border-radius: 10px; outline: none; background: #fff; }
input:focus { border-color: var(--s500); }

/* ---- 上部 ---- */
.dv-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--s900); color: #fff; padding: 0 20px; height: 54px; position: sticky; top: 0; z-index: 10;
}
.dv-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; color: #fff; text-decoration: none; }
.dv-brand-mark { color: var(--teal); font-size: 17px; }
.dv-top-right { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.dv-usage { color: var(--s400); white-space: nowrap; }
.dv-who { color: var(--s200); }
.dv-login { color: var(--teal); text-decoration: none; font-weight: 700; white-space: nowrap; }
.dv-login:hover { color: #fff; }
.dv-logout { background: none; border: 1px solid var(--s700); color: var(--s400); border-radius: 8px; padding: 4px 10px; font-size: 12px; }
.dv-logout:hover { color: #fff; border-color: var(--s500); }

/* ---- 操作列 ---- */
.dv-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--s200);
}
.dv-btn {
  background: #fff; color: var(--s700); border: 1px solid var(--s200); border-radius: 10px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.dv-btn:hover { background: var(--s100); }
.dv-btn.primary { background: var(--s900); color: #fff; border-color: var(--s900); }
.dv-btn.primary:hover { background: var(--s700); }
.dv-btn.ghost { border-color: transparent; color: var(--s500); }
.dv-btn.ghost:hover { background: var(--s100); }
.dv-btn.on { background: #f0fdfa; border-color: var(--teal); color: var(--teal-d); }
.dv-search { flex: 1; min-width: 160px; display: flex; }
.dv-search input { width: 100%; }

/* ---- パンくず ---- */
.dv-crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 14px 20px 6px; font-size: 13px; }
.dv-crumb a { color: var(--s500); text-decoration: none; }
.dv-crumb a:hover { color: var(--teal-d); text-decoration: underline; }
.dv-crumb .sep { color: var(--s400); }
.dv-crumb .cur { font-weight: 800; color: var(--s900); font-size: 15px; }
.dv-crumb .dv-crumb-act { margin-left: auto; display: flex; gap: 8px; }

.dv-notice {
  margin: 8px 20px 0; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.7;
  background: #f0fdfa; border: 1px solid #99f6e4; color: var(--teal-d);
}
.dv-notice.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.dv-notice.err { background: #fef2f2; border-color: #fecaca; color: var(--red); }

/* ---- 一覧 ---- */
.dv-main { flex: 1; padding: 10px 20px 30px; position: relative; }
.dv-list { background: #fff; border: 1px solid var(--s200); border-radius: 14px; overflow: hidden; }
.dv-row {
  display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--s100); font-size: 13.5px;
}
.dv-row:last-child { border-bottom: none; }
.dv-row:hover { background: var(--s50); }
.dv-row .ic { font-size: 19px; text-align: center; line-height: 1; }
.dv-nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dv-nm a, .dv-nm span.t { color: var(--s900); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.dv-nm a:hover { color: var(--teal-d); text-decoration: underline; }
.dv-sub { font-size: 11.5px; color: var(--s400); display: flex; gap: 8px; flex-wrap: wrap; }
.dv-size { font-size: 12px; color: var(--s500); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dv-act { display: flex; gap: 4px; align-items: center; }
.dv-mini {
  background: none; border: 1px solid var(--s200); border-radius: 8px; padding: 3px 8px;
  font-size: 11.5px; color: var(--s500); white-space: nowrap;
}
.dv-mini:hover { background: var(--s100); color: var(--s700); }
.dv-mini.danger { color: var(--red); border-color: #fecaca; }
.dv-mini.danger:hover { background: #fef2f2; }
.dv-tag { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; border: 1px solid; }
.dv-tag.priv { color: var(--amber); border-color: #fde68a; background: #fffbeb; }
.dv-empty { padding: 48px 20px; text-align: center; color: var(--s400); font-size: 13px; line-height: 2; }

/* グリッド表示(画像を並べて見るとき) */
.dv-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; background: none; border: none; }
.dv-list.grid .dv-row {
  display: block; background: #fff; border: 1px solid var(--s200); border-radius: 12px; padding: 10px; overflow: hidden;
}
.dv-list.grid .dv-thumb {
  height: 104px; border-radius: 8px; background: var(--s100) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--s400); margin-bottom: 8px;
}
.dv-list.grid .dv-size { margin-top: 4px; display: block; }
.dv-list.grid .dv-act { margin-top: 8px; flex-wrap: wrap; }
.dv-list.grid .ic { display: none; }

/* ---- ドラッグ&ドロップ ---- */
.dv-drophint {
  position: fixed; inset: 54px 0 0; background: rgba(13, 148, 136, .1); border: 3px dashed var(--teal);
  display: none; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; color: var(--teal-d); z-index: 30;
}
body.dv-dragging .dv-drophint { display: flex; }

/* ---- アップロード待ち行列 ---- */
.dv-queue {
  position: fixed; right: 16px; bottom: 16px; width: min(330px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--s200); border-radius: 14px; box-shadow: 0 10px 32px rgba(15,23,42,.16);
  z-index: 40; overflow: hidden;
}
.dv-queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--s900); color: #fff; font-size: 12.5px; font-weight: 700;
}
.dv-queue > div:last-child { max-height: 42vh; overflow-y: auto; }
.dv-qrow { padding: 9px 12px; border-bottom: 1px solid var(--s100); font-size: 12px; }
.dv-qrow:last-child { border-bottom: none; }
.dv-qname { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.dv-qname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-qname span { color: var(--s400); white-space: nowrap; }
.dv-bar-outer { height: 5px; background: var(--s100); border-radius: 999px; overflow: hidden; }
.dv-bar-in { height: 100%; width: 0; background: var(--teal); transition: width .18s linear; }
.dv-qrow.err .dv-bar-in { background: var(--red); }
.dv-qrow.done .dv-bar-in { background: var(--green); }
.dv-x { background: none; border: none; color: inherit; font-size: 14px; opacity: .8; }
.dv-x:hover { opacity: 1; }

/* ---- モーダル(プレビュー・移動先の選択) ---- */
.dv-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.dv-modal-back { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.dv-modal-card {
  position: relative; background: #fff; border-radius: 16px; width: min(960px, 100%); max-height: 90dvh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(15,23,42,.3);
}
.dv-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--s100); font-weight: 700; font-size: 14px;
}
.dv-modal-body { padding: 16px; overflow: auto; }
.dv-modal-body img, .dv-modal-body video { max-width: 100%; max-height: 68dvh; display: block; margin: 0 auto; border-radius: 8px; }
.dv-modal-body iframe { width: 100%; height: 68dvh; border: 1px solid var(--s200); border-radius: 8px; }
.dv-modal-body pre { background: var(--s50); border: 1px solid var(--s200); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.7; overflow: auto; max-height: 68dvh; }
.dv-pick { border: 1px solid var(--s200); border-radius: 12px; max-height: 46dvh; overflow: auto; }
.dv-pick button { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--s100); padding: 10px 14px; font-size: 13px; color: var(--s700); }
.dv-pick button:hover { background: var(--s100); }
.dv-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dv-kv { font-size: 12.5px; line-height: 2; color: var(--s700); }
.dv-kv b { color: var(--s500); font-weight: 600; display: inline-block; min-width: 96px; }
.dv-link {
  display: flex; gap: 6px; margin-top: 12px;
}
.dv-link input { flex: 1; font-size: 12px; }

/* ---- 下部 ---- */
.dv-foot {
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--s200);
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  font-size: 11.5px; color: var(--s400); background: #fff;
}

@media (max-width: 700px) {
  .dv-top { padding: 0 14px; }
  .dv-bar { padding: 10px 14px; }
  .dv-crumb, .dv-main, .dv-foot { padding-left: 14px; padding-right: 14px; }
  .dv-row { grid-template-columns: 26px 1fr auto; row-gap: 6px; }
  .dv-row .dv-act { grid-column: 1 / -1; justify-content: flex-end; }
  .dv-usage { display: none; }
}
