/* Banteng Drive — tema PDIP (selaras SIPP) */
:root {
  color-scheme: light;
  --pdip: #b00701;
  --pdip-dark: #890500;
  --pdip-deep: #3a0600;
  --pdip-soft: rgba(176, 7, 1, 0.10);
  --pdip-border: rgba(176, 7, 1, 0.22);
  --pdip-glow: rgba(176, 7, 1, 0.35);

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: var(--pdip);
  --accent-hover: var(--pdip-dark);
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.10);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Auth (login) split layout ── */
.page-auth { background: #fafafa; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.auth-brand {
  position: relative;
  display: none;
  width: 52%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: linear-gradient(145deg, #0a0a0c 0%, #110408 60%, #1a0608 100%);
  color: #fff;
}

.auth-brand-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.auth-brand-glow--tl {
  top: -8rem; left: -8rem;
  width: 24rem; height: 24rem;
  background: radial-gradient(circle, var(--pdip-glow) 0%, transparent 70%);
  filter: blur(60px);
  opacity: .9;
}
.auth-brand-glow--br {
  bottom: -10rem; right: -5rem;
  width: 31rem; height: 31rem;
  background: radial-gradient(circle, rgba(176,7,1,.25) 0%, transparent 65%);
  filter: blur(80px);
}
.auth-brand-grid {
  position: absolute; inset: 0;
  opacity: .06;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 28px 28px;
}
.auth-brand-edge {
  position: absolute; top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--pdip) 30%, var(--pdip) 70%, transparent);
}

.auth-brand-strip {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: .75rem;
  padding: 2.5rem 2.5rem 0;
}
.auth-brand-strip-line { flex: 1; height: 1px; background: rgba(176,7,1,.35); }
.auth-brand-strip-text {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(176,7,1,.75);
}

.auth-brand-center {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 2rem 3rem;
}

.auth-logo {
  animation: floatLogo 6s ease-in-out infinite;
  filter: drop-shadow(0 0 32px rgba(176,7,1,.55)) drop-shadow(0 4px 24px rgba(0,0,0,.8));
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo { animation: none; }
  .auth-brand-title { animation: none; }
  .btn, .fm-row, .quota-fill { transition: none; }
}

.auth-brand-divider {
  width: 3rem; height: 2px;
  margin: 1.25rem auto .75rem;
  border-radius: 999px;
  background: var(--pdip);
}

.auth-brand-title {
  margin: 0 0 .5rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, #fff 0%, #fca5a5 45%, #fff 60%, #fecaca 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.auth-brand-sub {
  margin: 0 0 1.5rem;
  color: rgba(255,255,255,.45);
  line-height: 1.5;
  font-size: .95rem;
}

.auth-brand-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
  background: rgba(176,7,1,.12);
  border: 1px solid rgba(176,7,1,.3);
}
.auth-brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pdip);
  box-shadow: 0 0 6px var(--pdip);
}

.auth-brand-footer {
  position: relative; z-index: 1;
  margin: 0;
  padding: 0 2.5rem 2rem;
  text-align: center;
  font-size: .75rem;
  color: rgba(255,255,255,.2);
}

.auth-panel {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  background: #fafafa;
  min-height: 100dvh;
}
.auth-panel-accent {
  position: absolute; top: 0; left: 0;
  width: 10rem; height: 10rem;
  opacity: .05;
  background: radial-gradient(circle at top left, var(--pdip), transparent 70%);
  pointer-events: none;
}
.auth-mobile-logo {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; margin-bottom: 2rem;
}
.auth-mobile-logo h1 {
  margin: .75rem 0 0;
  font-size: 1.35rem; font-weight: 900; color: var(--text);
}
.auth-mobile-logo img { filter: drop-shadow(0 4px 16px rgba(176,7,1,.25)); }
.auth-panel-inner { width: 100%; max-width: 380px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--pdip);
}

.auth-panel-footer {
  margin: 2.5rem 0 0;
  font-size: .75rem;
  color: #94a3b8;
  text-align: center;
}

.auth-card-title {
  margin: 0 0 .35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.auth-card-lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: .92rem;
}

@media (min-width: 1024px) {
  .auth-brand { display: flex; }
  .auth-mobile-logo, .auth-panel-footer { display: none; }
}

/* ── App topbar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
  background: linear-gradient(180deg, #111 0%, #0b0b0b 55%, #1a0608 100%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 4px 24px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar--public {
  background: linear-gradient(90deg, #0f0f10, #16070a);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  text-decoration: none;
}
.brand-logo {
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,.04);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; }
.brand-tag {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-tag--short { display: none; }

.topnav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  color: rgba(255,255,255,.9);
  background: rgba(176,7,1,.15);
  border: 1px solid rgba(176,7,1,.35);
  max-width: min(320px, 55vw);
  min-width: 0;
}
.user-chip-role {
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: #fca5a5;
  flex-shrink: 0;
}
.user-chip-name { min-width: 0; }

.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-wide { max-width: 1140px; margin: 0 auto; padding: 1.25rem; }

.page-files { background: var(--bg); }

/* ── Cards & controls ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { border-color: rgba(15,23,42,.15); background: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--pdip); outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(180deg, #c40802 0%, var(--pdip) 100%);
  border-color: var(--pdip-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(176,7,1,.28);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--pdip) 0%, var(--pdip-dark) 100%); }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); border-color: rgba(220,38,38,.25); background: #fef2f2; }
.btn.danger:hover { background: #fee2e2; }
.btn.sm { padding: .38rem .65rem; font-size: .8rem; }
.btn-ghost {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn.icon-btn { padding: .4rem .6rem; }

.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .4rem; font-size: .88rem; font-weight: 600; color: #334155; }
input, textarea {
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--pdip-border);
  box-shadow: 0 0 0 3px var(--pdip-soft);
}

.alert {
  margin: 0 0 1rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: .9rem;
}
.muted { color: var(--muted); }
.hidden { display: none !important; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }

/* ── File manager ── */
.fm { display: grid; gap: .85rem; }

.fm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 3px solid var(--pdip);
}
.fm-toolbar-left { display: flex; flex-wrap: wrap; gap: .5rem; }

.fm-quota { min-width: 200px; flex: 1; max-width: 300px; }
.quota-text { font-size: .78rem; color: var(--muted); margin-bottom: .4rem; font-weight: 600; }
.quota-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pdip), #e11d48);
  border-radius: 999px;
  transition: width .35s ease;
}

.breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  padding: .7rem 1rem;
  background: var(--surface-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.breadcrumb button,
.breadcrumb a {
  background: none; border: none;
  color: var(--pdip);
  cursor: pointer;
  font: inherit; font-weight: 600;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.breadcrumb button:hover,
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; flex-shrink: 0; }
.crumb-current {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.fm-dropzone {
  border: 2px dashed #e2e8f0;
  text-align: center;
  padding: 1.1rem;
  background: linear-gradient(180deg, #fff, #fafbfc);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.fm-dropzone.dragover {
  border-color: var(--pdip);
  background: var(--pdip-soft);
  box-shadow: inset 0 0 0 1px var(--pdip-border);
}
.dropzone-hint { margin: 0; color: var(--muted); font-size: .88rem; }
.upload-progress { font-size: .85rem; color: var(--pdip); font-weight: 600; }
.fm-upload-status {
  border-top: 3px solid var(--pdip);
  padding: .75rem 1rem;
  background: linear-gradient(180deg, #fff, #fef2f2);
}

.fm-list-wrap { padding: 0; overflow: hidden; }
.fm-list-wrap .fm-row { padding-left: 1rem; padding-right: 1rem; }
.fm-list-wrap .fm-empty { padding: 2.5rem 1rem; }
.fm-list { min-height: 120px; }
.fm-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}
.fm-row:last-child { border-bottom: none; }
.fm-row:hover { background: #f8fafc; }
.fm-row.folder { cursor: pointer; }
.fm-row--previewable { cursor: pointer; }
.fm-row.folder:hover .fm-label { color: var(--pdip); }
.fm-row--previewable:hover .fm-label { color: var(--pdip); }
.fm-row.folder:focus-visible,
.fm-row--previewable:focus-visible {
  outline: 2px solid var(--pdip);
  outline-offset: 2px;
  background: #f8fafc;
}
.fm-row-main { min-width: 0; }

.fm-name {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  min-width: 0;
  font-weight: 600;
}
.fm-label {
  word-break: break-word;
  line-height: 1.35;
}
.fm-name-link {
  color: inherit;
  text-decoration: none;
}
.fm-name-link:hover .fm-label { color: var(--pdip); }
.fm-name .icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.35; }
.fm-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: .35rem;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}
@media (min-width: 900px) {
  .fm-row {
    grid-template-columns: 1fr auto;
    padding: 1rem 1.15rem;
  }
  .fm-actions { flex-wrap: nowrap; }
}
.fm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
  align-items: center;
}

.fm-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.fm-empty-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.fm-empty p { margin: .25rem 0; }

.share-breadcrumb {
  margin: .75rem 0 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.share-list { margin-top: .5rem; }
.share-list .fm-row {
  padding: .85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.share-list .fm-row:last-child { border-bottom: none; }
.share-list .fm-row.folder .fm-name-link {
  display: flex;
  min-height: 44px;
  align-items: center;
}

body.modal-open { overflow: hidden; }

.share-item {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .5rem 0;
  padding: .65rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.share-item .btn { align-self: flex-start; }

.preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.preview-header h2 {
  border: none; padding: 0; margin: 0;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.preview-header .icon-btn {
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  background: var(--surface-2);
}

.preview-text {
  margin: 0;
  padding: 1rem;
  max-height: 50vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .85rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

/* ── Modal ── */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: 520px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(4px); }
.modal[open] {
  margin: auto;
}
.modal-preview { max-width: min(920px, 96vw); }
.modal-preview .preview-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  margin: -1.35rem -1.35rem 0;
  padding: 1.35rem 1.35rem .5rem;
}
.modal-body { padding: 1.35rem; }
.modal-body h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--pdip-soft);
}
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap; }

.preview-content {
  min-height: 200px;
  max-height: 70vh;
  overflow: auto;
  margin-top: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preview-content img { max-width: 100%; height: auto; display: block; margin: 0 auto; padding: .5rem; }
.preview-content iframe { width: 100%; height: 65vh; border: none; }
.preview-content .preview-media {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  background: #000;
}
.preview-content audio.preview-media {
  background: transparent;
  min-height: 48px;
}
.preview-content pre {
  margin: 0; padding: 1rem;
  white-space: pre-wrap; word-break: break-word;
  font-size: .85rem;
}

.share-result { display: flex; gap: .5rem; margin-top: 1rem; }
.share-result input { flex: 1; font-size: .85rem; background: #f8fafc; }
.share-existing { margin: 1rem 0; font-size: .85rem; }
.share-existing .share-link {
  display: block; margin: .35rem 0;
  word-break: break-all; color: var(--pdip); font-weight: 600;
}
.share-expires {
  display: block;
  font-size: .78rem;
  font-weight: 500;
}

/* ── Public share page ── */
.page-public .topbar {
  padding-top: max(.75rem, env(safe-area-inset-top));
}

.container-public {
  padding-top: 1rem;
}
.share-page { border-top: 3px solid var(--pdip); }
.share-page h1 { margin-top: 0; font-size: 1.25rem; font-weight: 800; }
.share-actions { margin-top: 1rem; }
.share-actions .btn.block { width: 100%; }
.preview-frame { margin: 1rem 0; }
.preview-frame img,
.preview-frame iframe,
.preview-frame video,
.preview-frame audio {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.preview-frame iframe { width: 100%; height: 70vh; border: none; }
.preview-frame video {
  width: 100%;
  max-height: 70vh;
  background: #000;
}
.preview-frame audio { width: 100%; min-height: 48px; }

.preview-office {
  overflow: auto;
  max-height: 70vh;
  padding: .5rem;
  -webkit-overflow-scrolling: touch;
}
.preview-office.xlsx {
  overflow-x: auto;
}
.preview-office.xlsx table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.preview-office.xlsx th,
.preview-office.xlsx td {
  border: 1px solid #e2e8f0;
  padding: .35rem .5rem;
  text-align: left;
  vertical-align: top;
}
.preview-office.xlsx th {
  background: #f1f5f9;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.preview-office.docx {
  background: #fff;
  padding: .5rem;
}

.page-404 h1 { margin-top: 0; }
.page-404 .btn { margin-top: .5rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--pdip);
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 340px;
  font-weight: 600;
  font-size: .9rem;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }

@media (max-width: 899.98px) {
  .fm-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: .65rem;
    padding: 1rem;
  }
  .fm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
    width: 100%;
    justify-content: stretch;
  }
  .fm-actions .btn,
  .fm-actions a.btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  input, textarea, select {
    font-size: 16px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: .65rem .85rem;
    padding-top: max(.65rem, env(safe-area-inset-top));
  }

  .brand-text { max-width: calc(100vw - 8rem); }
  .brand-name { font-size: .92rem; }
  .brand-tag--long { display: none; }
  .brand-tag--short { display: block; }

  .fm-dropzone { display: none; }

  .topnav {
    width: 100%;
    justify-content: space-between;
    gap: .5rem;
  }

  .topnav .btn-ghost {
    min-height: 44px;
    padding: .5rem .85rem;
  }

  .user-chip {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .user-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .container,
  .container-wide {
    padding: .75rem;
    padding-left: max(.75rem, env(safe-area-inset-left));
    padding-right: max(.75rem, env(safe-area-inset-right));
  }

  .fm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .fm-toolbar-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .fm-toolbar-left .btn { width: 100%; min-height: 44px; }
  .fm-quota { max-width: none; width: 100%; }

  .share-item .btn {
    align-self: stretch;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .share-list .fm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
    width: 100%;
  }
  .share-list .fm-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .preview-header {
    flex-direction: column;
    align-items: stretch;
  }
  .preview-header .icon-btn {
    align-self: flex-end;
  }

  .fm-meta-line {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    font-size: .72rem;
  }

  .fm-list-wrap .fm-row {
    padding-left: .85rem;
    padding-right: .85rem;
  }

  #btn-create-share {
    width: 100%;
    min-height: 44px;
  }

  .modal-actions .btn {
    min-height: 44px;
    flex: 1;
  }

  .modal-preview .preview-header {
    margin: -1rem -1rem 0;
    padding: 1rem 1rem .5rem;
  }

  .modal {
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    inset: 0;
  }
  .modal-preview {
    max-width: none;
  }
  .modal-body {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .preview-content {
    max-height: calc(100dvh - 8rem);
  }
  .preview-content iframe {
    height: calc(100vh - 10rem);
  }
  .preview-content video.preview-media {
    max-height: calc(100vh - 10rem);
  }

  .share-result {
    flex-direction: column;
  }
  .share-result .btn { width: 100%; min-height: 44px; }

  .toast {
    left: .75rem;
    right: .75rem;
    bottom: max(.75rem, env(safe-area-inset-bottom));
    max-width: none;
  }

  .auth-panel {
    padding: 1.25rem 1rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
  .auth-panel-inner { max-width: none; }

  .page-public .container {
    padding-left: max(.75rem, env(safe-area-inset-left));
    padding-right: max(.75rem, env(safe-area-inset-right));
    padding-bottom: max(.75rem, env(safe-area-inset-bottom));
  }

  @media (hover: none) {
    .fm-row.folder .fm-meta-line span:first-child::after {
      content: ' · ketuk untuk buka';
      color: var(--pdip);
      font-weight: 600;
    }
    .fm-row--previewable .fm-meta-line span:first-child::after {
      content: ' · ketuk untuk lihat';
      color: var(--pdip);
      font-weight: 600;
    }
  }

  .share-page h1 {
    font-size: 1.05rem;
    word-break: break-word;
  }
  .preview-frame iframe {
    height: 55vh;
  }
}

@media (max-width: 480px) {
  .user-chip-role { display: none; }
}
