:root {
  color-scheme: dark;
  --bg: #101820;
  --surface: #18232b;
  --surface-strong: #202e38;
  --line: #31424e;
  --text: #f5f1e8;
  --muted: #aebbc3;
  --gold: #f2c14e;
  --gold-strong: #ffcf5d;
  --cyan: #54d6c6;
  --cyan-strong: #69e8da;
  --danger: #ff7b72;
  --success: #7ee787;
  --shadow: 0 22px 70px rgba(2, 8, 12, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(145deg, rgba(84, 214, 198, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(242, 193, 78, 0.11), transparent 38%),
    var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(242, 193, 78, 0.45);
  border-radius: 8px;
  background: #1f2a32;
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 1rem + 1.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0;
}

.brand p,
.panel-heading p,
.dropzone-meta,
.trust-strip span {
  color: var(--muted);
}

.brand p {
  margin-top: 2px;
  font-size: 0.96rem;
}

.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid rgba(84, 214, 198, 0.35);
  border-radius: 999px;
  background: rgba(84, 214, 198, 0.08);
  color: var(--cyan-strong);
  font-weight: 700;
}

.security-chip span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 18px rgba(126, 231, 135, 0.8);
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 35, 43, 0.94);
  box-shadow: var(--shadow);
}

.panel-encrypt {
  border-top-color: rgba(242, 193, 78, 0.62);
}

.panel-decrypt {
  border-top-color: rgba(84, 214, 198, 0.62);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 22px 22px 14px;
}

.panel-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--gold);
}

.panel-decrypt .panel-icon {
  color: var(--cyan-strong);
}

.panel-icon svg {
  width: 24px;
  height: 24px;
}

h2 {
  font-size: 1.18rem;
  letter-spacing: 0;
}

.panel-heading p {
  margin-top: 4px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.task-form {
  display: grid;
  gap: 14px;
  padding: 8px 22px 22px;
}

.dropzone {
  display: grid;
  min-height: 178px;
  place-items: center;
  gap: 8px;
  padding: 24px;
  border: 1.5px dashed #50636f;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    rgba(12, 19, 24, 0.38);
  text-align: center;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--gold);
  background: rgba(242, 193, 78, 0.07);
}

.panel-decrypt .dropzone:hover,
.panel-decrypt .dropzone.is-dragging {
  border-color: var(--cyan-strong);
  background: rgba(84, 214, 198, 0.07);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dropzone-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--gold);
}

.panel-decrypt .dropzone-icon {
  color: var(--cyan-strong);
}

.dropzone-icon svg {
  width: 27px;
  height: 27px;
}

.dropzone-title {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 800;
}

.dropzone-meta {
  font-size: 0.86rem;
  line-height: 1.35;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d151b;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.15);
}

.panel-decrypt .field input:focus {
  border-color: var(--cyan-strong);
  box-shadow: 0 0 0 3px rgba(84, 214, 198, 0.15);
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: #6f8794;
  color: var(--text);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #0d151b;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition:
    width 160ms ease,
    background 160ms ease;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: #101820;
  font-weight: 900;
  letter-spacing: 0;
}

.primary-action {
  background: var(--gold);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--gold-strong);
}

.secondary-action {
  background: var(--cyan);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: var(--cyan-strong);
}

.primary-action svg,
.secondary-action svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.1;
}

.status {
  display: block;
  min-height: 48px;
  padding: 0 22px 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.status[data-state="ok"] {
  color: var(--success);
}

.status[data-state="error"] {
  color: var(--danger);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.trust-strip div {
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 21, 27, 0.72);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  font-size: 0.98rem;
}

.trust-strip span {
  margin-top: 4px;
  font-size: 0.86rem;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .topbar,
  .workspace,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .security-chip {
    width: fit-content;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 18px, 420px);
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .panel-heading,
  .task-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .dropzone {
    min-height: 154px;
    padding: 18px 14px;
  }

  .status {
    padding-left: 16px;
    padding-right: 16px;
  }
}
