:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  letter-spacing: 0;
  --bg: #f5f5f7;
  --card-bg: rgba(255, 255, 255, .92);
  --modal-bg: rgba(255, 255, 255, .96);
  --header-bg: rgba(250, 250, 252, .82);
  --input-bg: rgba(255, 255, 255, .92);
  --input-focus-bg: #fff;
  --text: #1d1d1f;
  --text-label: #3a3a3c;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --red: #d70015;
  --green: #248a3d;
  --label-secondary: #6e6e73;
  --label-tertiary: #86868b;
  --fill-hover: #e8e8ed;
  --separator: #d2d2d7;
  --hairline: rgba(0, 0, 0, .12);
  --focus: rgba(0, 113, 227, .28);
  --shadow: 0 12px 36px rgba(0, 0, 0, .08);
  --tab-bg: #e8e8ed;
  --tab-active-bg: #fff;
  --tab-active-text: #1d1d1f;
  --code-bg: #f5f5f7;
  --badge-blue-bg: #e8f3ff;
  --badge-green-bg: #eaf6ed;
  --badge-warning-bg: rgba(255, 149, 0, .15);
  --badge-warning-text: #c97000;
  --badge-muted-bg: rgba(142, 142, 147, .16);
  --badge-muted-text: #636366;
  --badge-admin-bg: rgba(94, 92, 230, .14);
  --badge-admin-text: #5856d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --card-bg: rgba(38, 38, 40, .92);
    --modal-bg: rgba(44, 44, 46, .96);
    --header-bg: rgba(28, 28, 30, .82);
    --input-bg: rgba(44, 44, 46, .85);
    --input-focus-bg: #2c2c2e;
    --text: #f5f5f7;
    --text-label: #d1d1d6;
    --blue: #0a84ff;
    --blue-hover: #409cff;
    --red: #ff453a;
    --green: #30d158;
    --label-secondary: #98989d;
    --label-tertiary: #636366;
    --fill-hover: #3a3a3c;
    --separator: #38383a;
    --hairline: rgba(255, 255, 255, .12);
    --focus: rgba(10, 132, 255, .35);
    --shadow: 0 12px 36px rgba(0, 0, 0, .45);
    --tab-bg: #2c2c2e;
    --tab-active-bg: #48484a;
    --tab-active-text: #fff;
    --code-bg: #2c2c2e;
    --badge-blue-bg: rgba(10, 132, 255, .2);
    --badge-green-bg: rgba(48, 209, 88, .2);
    --badge-warning-bg: rgba(255, 159, 10, .25);
    --badge-warning-text: #ff9f0a;
    --badge-muted-bg: rgba(142, 142, 147, .2);
    --badge-muted-text: #98989d;
    --badge-admin-bg: rgba(94, 92, 230, .25);
    --badge-admin-text: #7d7aff;
  }
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.language-setting { margin-bottom: 14px; }
.language-setting .group-row { justify-content: space-between; }
.language-setting .group-row > label { width: auto; color: var(--text); font-weight: 500; }
.language-setting .group-field { flex: 0 0 auto; }
.language-setting select { width: auto !important; min-width: 72px; text-align: right; text-align-last: right; cursor: pointer; }
html[lang="en"] button, html[lang="en"] label, html[lang="en"] .modal-tab { overflow-wrap: anywhere; }

button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button, .file-picker, summary { cursor: pointer; }

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 15px;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: inherit;
  font-weight: 500;
  line-height: 1.2;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

button:disabled { opacity: .42; cursor: not-allowed; }
button:not(:disabled):hover { background: var(--fill-hover); }
button:focus-visible, a:focus-visible, summary:focus-visible, .file-picker:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 71, 171, .18);
}

.primary:not(:disabled):hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.secondary {
  border-color: var(--hairline);
  background: var(--input-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.destructive {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.destructive:not(:disabled):hover { background: #c40013; }
.danger { color: var(--red); }
.has-updates { color: var(--blue); background: var(--badge-blue-bg); }
.active-share { color: var(--green); background: var(--badge-green-bg); }

button.copy-confirmed { position: relative; }

button.copy-confirmed::after {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(100% + 7px);
  padding: 4px 7px;
  border-radius: 4px;
  background: #1d1d1f;
  color: #fff;
  content: attr(data-copy-feedback);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 9px;
  border-radius: 50%;
}

.lucide {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--header-bg);
  box-shadow: 0 1px 0 var(--hairline);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.header-inner, .workspace {
  width: min(100% - 48px, 960px);
  margin: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand, .tools, .section-heading, .section-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
}

h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 9px;
}

h2 > .lucide { color: var(--label-secondary); }

.workspace { padding: 22px 0 56px; }

.compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding: 18px 0 38px;
}

.compose > section { min-width: 0; }

textarea, input[type="text"], input[type="password"], input[type="number"], select {
  display: block;
  width: 100%;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--input-bg);
  color: inherit;
  padding: 13px 14px;
  outline: none;
  font-size: 16px;
  caret-color: var(--blue);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

textarea::placeholder { color: var(--label-tertiary); }

textarea:hover, input[type="text"]:hover, input[type="password"]:hover, input[type="number"]:hover, select:hover { border-color: var(--label-secondary); }

textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--blue);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--focus);
}

textarea {
  height: 80px;
  min-height: 80px;
  resize: vertical;
  line-height: 1.55;
}

.section-footer {
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
}

.section-footer #upload { min-width: 116px; }

.muted {
  color: var(--label-secondary);
  font-size: 12px;
  font-weight: 400;
}

.file-picker {
  position: relative;
  height: 80px;
  min-height: 80px;
  border: 1px dashed var(--separator);
  border-radius: 8px;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  color: var(--text);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.file-picker:hover {
  border-color: var(--blue);
  background: var(--input-focus-bg);
}

.file-picker:focus-within {
  border-color: var(--blue);
  background: var(--input-focus-bg);
}

.file-picker > .lucide {
  width: 22px;
  height: 22px;
  color: var(--blue);
  stroke-width: 1.7;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-list {
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.upload-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.upload-row > .muted {
  flex: 0 0 64px;
  text-align: right;
  white-space: nowrap;
}

progress {
  width: 100%;
  height: 5px;
  display: block;
  accent-color: var(--blue);
}

.history {
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
}

.app-footer {
  margin: 22px 0 18px;
  color: var(--label-tertiary);
  font-size: 12px;
  text-align: right;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  flex-wrap: wrap;
}

.history-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 20px 2px;
  border-bottom: 1px solid var(--hairline);
}

.history > .section-heading { flex-wrap: wrap; }
.history > .section-heading > .tools { margin-left: auto; }
.history-selection { display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.history-selection input { margin: 0; }
#selection-count { padding: 3px 8px; border-radius: 10px; background: #e8f3ff; color: var(--blue); font-size: 12px; font-weight: 500; white-space: nowrap; }
#selection-count:empty { display: none; }
.history-selection input, .history-select { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.item-selection { display: grid; justify-items: center; gap: 12px; }

.item-selection > .lucide {
  color: var(--label-secondary);
  margin-top: 3px;
}

.item-selection > .lucide-image { color: var(--blue); }

.item-content { min-width: 0; }

.thumbnail-link {
  display: block;
  width: min(160px, 100%);
  min-height: 0;
  aspect-ratio: 4 / 3;
  margin-top: 10px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-bg);
  cursor: zoom-in;
}

.thumbnail-link:not(:disabled):hover { background: var(--fill-hover); }

.file-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-text {
  margin: 7px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  max-height: 260px;
  overflow-y: auto;
}

.item-text-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.item-text-link:hover { color: var(--blue-hover); }

.item-name {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-weight: 500;
}

.item-actions { display: flex; gap: 3px; }

.file-link-preview, .site-link-preview {
  position: relative;
  z-index: 1;
  display: flex;
}

.qr-popover {
  position: absolute;
  z-index: 20;
  width: 210px;
  padding: 10px 10px 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  color: var(--label-secondary);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.qr-popover::after {
  position: absolute;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  background: var(--modal-bg);
  content: "";
  transform: rotate(45deg);
}

.qr-popover canvas {
  display: block;
  margin: 0 auto;
  width: 168px;
  height: 168px;
}

.qr-popover span {
  display: block;
  margin-top: 7px;
  text-align: center;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.file-link-qr {
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%) scale(.98);
  transform-origin: right center;
}

.file-link-qr::after {
  top: calc(50% - 7px);
  right: -7px;
}

.site-link-popover {
  top: calc(100% + 10px);
  right: -4px;
  transform: translateY(-4px) scale(.98);
  transform-origin: right top;
}

.site-link-popover::after {
  top: -7px;
  right: 17px;
  transform: rotate(-45deg);
}

.file-link-preview:hover,
.file-link-preview:focus-within,
.site-link-preview:hover,
.site-link-preview:focus-within { z-index: 30; }

.file-link-preview:hover .file-link-qr,
.file-link-preview:focus-within .file-link-qr {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.site-link-preview:hover .site-link-popover,
.site-link-preview:focus-within .site-link-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

a.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--blue);
  transition: background-color .18s ease;
}

a.icon-button:hover { background: var(--fill-hover); }

.empty {
  color: var(--label-secondary);
  text-align: center;
  padding: 44px 0;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px auto 0;
}

#notice {
  min-height: 24px;
  line-height: 1.6;
  font-size: 13px;
  color: var(--green);
  overflow-wrap: anywhere;
}

#notice.error { color: var(--red); }

#error-details {
  margin: 8px 0 16px;
  font-size: 13px;
  color: var(--red);
}

summary { border-radius: 4px; }

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
}

body[data-page="login"] {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.login-layout {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 28px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.login-layout .brand {
  justify-content: center;
  margin-bottom: 20px;
}

.brand-subtitle {
  margin: -12px 0 22px;
  text-align: center;
  font-size: 13px;
  color: var(--label-secondary);
  letter-spacing: .5px;
}

.login-layout h2 {
  margin-bottom: 22px;
  justify-content: center;
  font-size: 19px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 24px;
  padding: 3px;
  border-radius: 8px;
  background: var(--tab-bg);
}

.auth-tabs a {
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--label-secondary);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.auth-tabs a[aria-current="page"] {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.login-layout label {
  display: block;
  margin-bottom: 9px;
  color: var(--text-label);
  font-size: 14px;
  font-weight: 500;
}

.login-layout input + label,
.login-layout .password-field + label,
.login-layout .password-rules + label { margin-top: 16px; }

.login-layout button[type="submit"] {
  width: 100%;
  margin: 20px 0 14px;
}

.auth-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.login-language {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--label-secondary);
}

.login-language .lucide {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.login-language .lucide:first-child { left: 10px; }
.login-language .lucide:last-child { right: 10px; width: 12px; height: 12px; }

.login-language select {
  appearance: none;
  width: auto;
  min-height: 40px;
  padding: 8px 30px 8px 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.login-language select:hover {
  border-color: transparent;
  background: var(--fill-hover);
  color: var(--text);
}

.login-language select:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 7px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--label-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--fill-hover);
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 10px 0 16px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--fill-hover);
  font-size: 12px;
  color: var(--label-secondary);
}

.password-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .18s ease;
}

.password-rule.valid {
  color: var(--green);
  font-weight: 500;
}

.password-rule .lucide {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 20px;
  padding: 3px;
  border-radius: 10px;
  background: var(--tab-bg);
}

.modal-tab {
  min-height: 32px;
  border-radius: 7px;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--label-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
}

.modal-tab:not(.active):hover {
  color: var(--text);
}

.modal-tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .06);
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}

.history-filter-btn {
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--input-bg);
  color: var(--label-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all .16s ease;
}

.history-filter-btn:hover {
  background: var(--fill-hover);
  color: var(--text);
}

.history-filter-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 113, 227, .12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 3px dashed var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}

.drag-overlay .lucide {
  width: 48px;
  height: 48px;
}

.login-layout #notice { text-align: center; }

.auth-secondary-link {
  display: block;
  color: var(--blue);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
}

.auth-secondary-link:hover { text-decoration: underline; }

.auth-message {
  padding: 18px 0;
  color: var(--label-secondary);
  text-align: center;
}

.recovery-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.recovery-result code {
  display: block;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--separator);
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
}

dialog {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 40px);
  color: inherit;
  background: var(--modal-bg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#qr-canvas {
  display: block;
  margin: 18px auto;
  width: 200px;
  height: 200px;
  border-radius: 4px;
}

#site-url {
  overflow-wrap: anywhere;
  text-align: center;
  color: var(--label-secondary);
  font-size: 13px;
}

#copy-url {
  display: flex;
  margin: 0 auto;
}

#image-preview-dialog {
  width: min(1000px, calc(100% - 32px));
  max-width: 1000px;
  max-height: calc(100dvh - 32px);
  padding: 16px;
  overflow: hidden;
}

.image-preview-stage {
  display: flex;
  width: 100%;
  height: min(70dvh, 720px);
  min-height: 160px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #111113;
}

#image-preview-content {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#image-preview-status { color: #c7c7cc; }

.image-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

#image-preview-name {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 500;
}

.button-link {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.button-link:hover { background: var(--fill-hover); }

#temporary-share-dialog { max-width: 460px; }

#temporary-share-file {
  margin: 18px 0 4px;
  overflow-wrap: anywhere;
  font-weight: 600;
  line-height: 1.5;
}

#temporary-share-status { margin: 0 0 20px; }

#temporary-share-form > label {
  display: block;
  margin-bottom: 8px;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
}

.temporary-share-duration {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  gap: 10px;
}

#temporary-share-hours { min-width: 0; }

#temporary-share-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

#temporary-share-qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 0 auto 12px;
  border-radius: 4px;
}

#temporary-share-url {
  display: block;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#temporary-share-expiry { margin: 8px 0 0; }

.copy-notice {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

#temporary-share-actions { flex-wrap: wrap; }

.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.apple-group {
  background: var(--input-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}

.group-row {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--input-bg);
}

.group-row:last-child {
  border-bottom: none;
}

.group-row > label {
  width: 96px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--label-secondary);
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
}

html[lang="en"] .group-row > label {
  width: 148px;
}

.group-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.group-field input, .group-field select {
  width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 6px 4px !important;
  font-size: 13px !important;
  color: var(--text) !important;
  outline: none !important;
  box-shadow: none !important;
  min-height: 34px !important;
}

.group-field input[type="password"] {
  padding-right: 30px !important;
}

.group-field input::placeholder {
  color: var(--label-tertiary);
  font-size: 12px;
}

.group-field .password-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--label-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-field .password-toggle:hover {
  color: var(--text);
  background: transparent;
}

.group-field .password-toggle .lucide {
  width: 15px;
  height: 15px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.badge-admin {
  background: var(--badge-admin-bg);
  color: var(--badge-admin-text);
}

.badge-user {
  background: var(--fill-hover);
  color: var(--label-secondary);
}

.badge-success {
  background: var(--badge-green-bg);
  color: var(--green);
}

.badge-warning {
  background: var(--badge-warning-bg);
  color: var(--badge-warning-text);
}

.badge-muted {
  background: var(--badge-muted-bg);
  color: var(--badge-muted-text);
}

.section-subheading {
  margin: 16px 0 6px;
}

.section-subheading h3, .account-section h3 {
  margin: 0 0 6px 2px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--label-secondary);
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 2px;
}

.section-title-row h3 {
  margin: 0;
}

.recovery-status-text {
  font-size: 12px;
}

.registration-card {
  margin: 0 0 12px;
  padding: 10px 14px;
}

.registration-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.registration-setting span { display: grid; gap: 2px; }
.registration-setting strong { font-size: 13px; font-weight: 500; line-height: 1.3; }
.registration-setting small { color: var(--label-secondary); font-weight: 400; font-size: 11.5px; line-height: 1.35; }
.registration-setting input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }

#user-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.toggle input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
#user-form .dialog-actions { margin-top: 6px; }

.user-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  min-height: 42px;
  transition: background-color .15s ease;
}

.user-row:last-child { border-bottom: 0; }
.user-row:hover { background: var(--fill-hover); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tab-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta { flex: 1; min-width: 0; }
.user-name { overflow-wrap: anywhere; font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-detail { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.user-sep { color: var(--label-tertiary); font-size: 10px; }
.user-row .item-actions { justify-content: flex-end; gap: 2px; }
.user-row .icon-button { width: 26px; height: 26px; min-height: 26px; padding: 0; }
.user-row .icon-button .lucide { width: 14px; height: 14px; }
.user-disabled { opacity: .58; }

#account-dialog {
  max-width: 480px;
  border-radius: 16px;
  padding: 18px 20px;
  max-height: min(640px, calc(100dvh - 32px));
  overflow-y: auto;
}

.account-section {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.account-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.account-section form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-section .dialog-actions { margin-top: 6px; }
.account-danger { display: flex; justify-content: center; padding-top: 8px; }

.destructive-link {
  border: none;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  min-height: 28px;
  padding: 4px 8px;
}

.destructive-link:hover {
  background: rgba(255, 59, 48, .08);
  color: var(--red);
}

.delete-warning {
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 12px;
}

#delete-account-dialog {
  max-width: 400px;
  border-radius: 16px;
  padding: 18px 20px;
}

#delete-account-form { display: flex; flex-direction: column; gap: 8px; }
#delete-account-form .dialog-actions { margin-top: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

@media (max-width: 680px) {
  .header-inner, .workspace { width: calc(100% - 32px); }
  .header-inner { min-height: 62px; }
  .header-inner > .tools { gap: 4px; }
  .workspace { padding-top: 16px; }
  .compose { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 14px; }
  .history-item { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
  .item-actions { grid-column: 2; justify-content: flex-end; }
  .file-link-qr {
    top: auto;
    right: 0;
    bottom: calc(100% + 8px);
    transform: translateY(4px) scale(.98);
    transform-origin: right bottom;
  }
  .file-link-qr::after {
    top: auto;
    right: 13px;
    bottom: -7px;
    transform: rotate(135deg);
  }
  .file-link-preview:hover .file-link-qr,
  .file-link-preview:focus-within .file-link-qr { transform: translateY(0) scale(1); }
  .history .tools { gap: 4px; }
  .login-layout { padding: 28px 22px; }
  .login-layout .brand { margin-bottom: 30px; }
  #account-dialog, #delete-account-dialog {
    width: calc(100% - 24px);
    padding: 16px 14px;
  }
  html[lang="en"] .group-row > label {
    width: 132px;
    font-size: 12px;
  }
  .temporary-share-duration { grid-template-columns: minmax(0, 1fr); }
  .temporary-share-duration button { width: 100%; }
  #image-preview-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    padding: 12px;
  }
  .image-preview-stage { height: 62dvh; min-height: 180px; }
  .image-preview-footer { align-items: flex-start; }
}

@media (max-width: 340px) {
  .header-inner h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
