:root {
  --ink-950: #101828;
  --ink-900: #14213d;
  --ink-800: #1d2b4d;
  --ink-700: #344054;
  --ink-600: #475467;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --line-strong: #d0d5dd;
  --line: #e4e7ec;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f2f4f7;
  --blue: #2f6fed;
  --blue-dark: #245cc7;
  --blue-soft: #eef4ff;
  --green: #18794e;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fff7ed;
  --red: #b42318;
  --red-soft: #fef3f2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 14px 32px rgba(16, 24, 40, 0.09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --transition: 160ms ease;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: #edf1f6;
  line-height: 1.5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #edf1f6;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 15% -10%, rgba(47, 111, 237, 0.14), transparent 30%),
    linear-gradient(180deg, #f6f8fb 0, #edf1f6 45%, #e9eef4 100%);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.26);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  color: var(--ink-900);
  background: var(--surface-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 36px;
  border-bottom: 1px solid rgba(208, 213, 221, 0.86);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 24px rgba(16, 24, 40, 0.05);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--ink-900), #253b69);
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.24);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-600);
  background: var(--surface);
  font-size: 0.82rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-400);
  box-shadow: 0 0 0 4px rgba(152, 162, 179, 0.14);
}

.service-status[data-state="online"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(24, 121, 78, 0.12);
}

.service-status[data-state="error"] .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.main-content {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 210px;
  padding: 38px 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(105deg, rgba(20, 33, 61, 0.98), rgba(32, 57, 103, 0.96)),
    var(--ink-900);
  box-shadow: var(--shadow-md);
}

.hero-panel::after {
  position: absolute;
  top: -110px;
  right: -70px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(255, 255, 255, 0.025),
    0 0 0 130px rgba(255, 255, 255, 0.018);
  content: "";
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #a9c4ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.hero-panel p {
  max-width: 700px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  min-width: 380px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
}

.hero-metrics div {
  padding: 18px 20px;
  text-align: center;
}

.hero-metrics div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  font-size: 1.28rem;
}

.hero-metrics span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.tool-panel,
.processing-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tool-panel {
  align-self: start;
  padding: 26px;
}

.processing-panel {
  min-width: 0;
  padding: 30px;
}

.history-panel {
  margin-top: 22px;
  padding: 28px 30px;
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading h2,
.panel-heading p,
.file-section h3,
.action-card h3 {
  margin: 0;
}

.panel-heading h2 {
  font-size: 1.23rem;
  letter-spacing: -0.015em;
}

.panel-heading p {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.86rem;
}

.heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-number {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.tool-list {
  display: grid;
  gap: 9px;
}

.tool-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink-700);
  background: transparent;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.tool-card:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.tool-card.is-active {
  border-color: #c7d7fe;
  color: var(--ink-950);
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.tool-card strong,
.tool-card small {
  display: block;
}

.tool-card strong {
  font-size: 0.92rem;
}

.tool-card small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--ink-900);
  background: var(--surface-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.icon-office { background: #eaf2ff; color: #245cc7; }
.icon-image { background: #ecfdf3; color: #18794e; }
.icon-merge { background: #f4f3ff; color: #6941c6; }
.icon-split { background: #fff7ed; color: #b54708; }
.icon-compress { background: #fef3f2; color: #b42318; }

.privacy-card {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.privacy-card strong {
  font-size: 0.84rem;
}

.privacy-card p {
  margin: 7px 0 0;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.86rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button-quiet {
  border-color: var(--line);
  color: var(--ink-700);
  background: var(--surface);
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button-action {
  min-width: 170px;
  min-height: 48px;
  color: #fff;
  background: var(--ink-900);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.18);
}

.button-action:hover:not(:disabled) {
  background: #223762;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 36px 22px;
  border: 1.5px dashed #b9c3d3;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.72), rgba(242, 244, 247, 0.82)),
    var(--surface-soft);
  text-align: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 237, 0.08);
}

.drop-zone-visual {
  position: relative;
  width: 82px;
  height: 58px;
  margin-bottom: 18px;
}

.drop-zone-visual span {
  position: absolute;
  display: block;
  width: 42px;
  height: 52px;
  border: 1px solid #9eb4d9;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.08);
}

.drop-zone-visual span:nth-child(1) { left: 4px; top: 5px; transform: rotate(-9deg); }
.drop-zone-visual span:nth-child(2) { left: 34px; top: 6px; transform: rotate(8deg); }
.drop-zone-visual span:nth-child(3) { left: 20px; top: 0; border-color: #7ea4ec; }

.drop-zone > strong {
  font-size: 1.05rem;
}

.drop-zone > p {
  margin: 5px 0 18px;
  color: var(--ink-500);
  font-size: 0.86rem;
}

.drop-zone > small {
  margin-top: 13px;
  color: var(--ink-500);
  font-size: 0.73rem;
}

.options-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.option-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
}

.option-group.stacked {
  display: block;
}

.option-copy strong,
.option-copy span,
.option-group label > strong,
.option-group label > span {
  display: block;
}

.option-copy strong,
.option-group label > strong {
  font-size: 0.84rem;
}

.option-copy span,
.option-group label > span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.option-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #dce8ff;
  font-size: 0.7rem;
  font-weight: 800;
}

select,
.range-field input,
.token-dialog input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-950);
  background: var(--surface);
}

select {
  min-width: 190px;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.radio-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.radio-option input {
  margin-top: 3px;
  accent-color: var(--blue);
}

.radio-option strong,
.radio-option small {
  display: block;
}

.radio-option strong {
  font-size: 0.82rem;
}

.radio-option small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.range-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.range-field span {
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.file-section {
  margin-top: 24px;
}

.file-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.file-section h3 {
  font-size: 0.95rem;
}

.file-section-header span {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.file-list {
  display: grid;
  gap: 8px;
  max-height: 354px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.empty-state {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-400);
  background: var(--surface-soft);
  font-size: 0.82rem;
}

.file-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.file-type {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
}

.file-copy {
  min-width: 0;
}

.file-copy strong,
.file-copy span {
  display: block;
}

.file-copy strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-500);
  background: transparent;
  font-size: 0.82rem;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--ink-900);
  background: var(--surface-soft);
}

.icon-button.remove:hover:not(:disabled) {
  color: var(--red);
  background: var(--red-soft);
}

.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #f2f5f9);
}

.action-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.action-copy .section-number {
  margin-top: 4px;
}

.action-card h3 {
  font-size: 0.95rem;
}

.action-card p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.progress-card,
.result-card {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.progress-card {
  background: var(--blue-soft);
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.progress-heading strong,
.progress-heading span {
  display: block;
}

.progress-heading strong {
  font-size: 0.84rem;
}

.progress-heading div > span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.73rem;
}

#progressPercent {
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #d5e2fb;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #d5e2fb;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--blue);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--blue);
}

.result-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  border-color: #abefc6;
  background: var(--green-soft);
}

.result-card.is-error {
  border-color: #fecdca;
  background: var(--red-soft);
}

.result-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.result-card.is-error .result-icon {
  background: var(--red);
}

.result-card strong,
.result-card p {
  margin: 0;
}

.result-card strong {
  font-size: 0.85rem;
}

.result-card p {
  margin-top: 2px;
  color: var(--ink-600);
  font-size: 0.75rem;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.history-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-400);
  text-align: center;
  font-size: 0.8rem;
}

.history-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.history-item > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue-dark);
  background: #e4edff;
  font-size: 0.7rem;
  font-weight: 900;
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  font-size: 0.78rem;
}

.history-item small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 0.68rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 30px;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.token-dialog {
  width: min(520px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: var(--shadow-md);
}

.token-dialog::backdrop {
  background: rgba(16, 24, 40, 0.58);
  backdrop-filter: blur(3px);
}

.dialog-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.18rem;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-500);
  background: var(--surface);
  font-size: 1.2rem;
}

.dialog-card > p {
  margin: 16px 0;
  color: var(--ink-600);
  font-size: 0.82rem;
}

.dialog-card > label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.dialog-card > input {
  width: 100%;
}

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

.toast-region {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 32px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  color: var(--ink-700);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 0.8rem;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  border-left-color: var(--red);
}

[hidden] {
  display: none !important;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-metrics {
    width: 100%;
    min-width: 0;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .tool-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tool-card {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 106px;
    text-align: center;
  }

  .tool-card.is-active {
    box-shadow: inset 0 -3px 0 var(--blue);
  }

  .privacy-card {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 18px;
  }

  .service-status {
    display: none;
  }

  .main-content,
  .footer {
    width: min(100% - 24px, 1480px);
  }

  .hero-panel {
    min-height: 0;
    padding: 28px 24px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    text-align: left;
  }

  .hero-metrics div + div {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .hero-metrics span {
    margin: 0;
  }

  .tool-panel,
  .processing-panel,
  .history-panel {
    padding: 20px;
  }

  .tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card:last-child {
    grid-column: 1 / -1;
  }

  .option-group,
  .action-card {
    align-items: stretch;
    flex-direction: column;
  }

  select {
    width: 100%;
  }

  .history-list {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .brand small,
  .topbar-actions .button span {
    display: none;
  }

  .topbar {
    min-height: 66px;
  }

  .main-content {
    padding-top: 18px;
  }

  .hero-panel h1 {
    font-size: 1.75rem;
  }

  .hero-panel p {
    font-size: 0.86rem;
  }

  .tool-list {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .tool-card:last-child {
    grid-column: auto;
    grid-template-columns: 42px 1fr;
    justify-items: stretch;
    min-height: 68px;
    text-align: left;
  }

  .tool-card.is-active {
    box-shadow: inset 3px 0 0 var(--blue);
  }

  .processing-panel,
  .history-panel {
    padding: 18px;
  }

  .heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .drop-zone {
    min-height: 245px;
    padding: 28px 16px;
  }

  .action-card {
    padding: 16px;
  }

  .button-action {
    width: 100%;
  }

  .result-card {
    grid-template-columns: 38px 1fr;
  }

  .result-card .button {
    grid-column: 1 / -1;
  }

  .file-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}
