:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #eef4f8;
  color: #18202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(239, 244, 248, 0.7), rgba(239, 244, 248, 0.86)),
    url("/dachshund-bg.png") center top / 520px auto repeat;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px max(18px, calc((100vw - 960px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(201, 210, 221, 0.9);
  backdrop-filter: blur(8px);
}

.home-link,
.menu-button,
.menu-item,
.module-card {
  border: 0;
  font: inherit;
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.header-logo {
  width: min(218px, 58vw);
  height: auto;
}

.menu-shell {
  position: relative;
  flex: 0 0 auto;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  gap: 1px;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid #c8d4df;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: #1f4e78;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 8px;
  border: 1px solid #c8d4df;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(31, 45, 61, 0.16);
}

.menu-item {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: #18202a;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: #eef4f8;
}

.menu-item:disabled {
  color: #8a96a5;
  cursor: default;
}

.menu-item:disabled:hover {
  background: transparent;
}

.logout-item {
  margin-top: 6px;
  border-top: 1px solid #e1e7ee;
  color: #93582f;
}

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

.panel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(2px);
  border: 1px solid #d7dde5;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(31, 45, 61, 0.08);
  padding: 26px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #1f4e78, #93582f);
}

.panel + .panel {
  margin-top: 18px;
}

.topbar,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-logo {
  width: clamp(176px, 31vw, 252px);
  height: auto;
  flex: 0 0 auto;
}

.home-panel {
  min-height: 380px;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-panel {
  padding: 30px;
}

.login-logo {
  width: min(260px, 100%);
  height: auto;
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

#login-button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: linear-gradient(135deg, #1f4e78, #163f63);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#login-button:hover {
  background: linear-gradient(135deg, #163f63, #102f4b);
}

.login-error {
  margin: 16px 0 0;
  border: 1px solid #e9aeb4;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8d7da;
  color: #842029;
  font-size: 14px;
  font-weight: 700;
}

.home-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.home-logo {
  width: min(300px, 52vw);
  height: auto;
  flex: 0 0 auto;
}

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

.module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #fbfcfe;
  color: #18202a;
  text-align: left;
  cursor: pointer;
}

.module-card:hover {
  border-color: #9fb5ca;
  background: #f3f8fc;
}

.module-card:disabled {
  color: #7d8794;
  cursor: default;
}

.module-card:disabled:hover {
  border-color: #d7dde5;
  background: #fbfcfe;
}

.module-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #1f4e78;
  color: #ffffff;
  font-weight: 800;
}

.module-icon.muted {
  background: #dce4ed;
  color: #546274;
}

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

.module-card strong {
  font-size: 17px;
}

.module-card small {
  margin-top: 4px;
  color: #5d6a79;
  font-size: 13px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 6px;
  color: #93582f;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
}

.status {
  min-width: 96px;
  border: 1px solid #c8d4df;
  border-radius: 6px;
  padding: 8px 12px;
  text-align: center;
  color: #2f3a48;
  background: rgba(248, 250, 252, 0.92);
  font-size: 14px;
  font-weight: 650;
}

.status.busy {
  color: #754c00;
  background: #fff6df;
  border-color: #f0cf87;
}

.status.done {
  color: #0f5132;
  background: #e9f7ef;
  border-color: #a7d7bb;
}

.status.error {
  color: #842029;
  background: #f8d7da;
  border-color: #e9aeb4;
}

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

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

.field span {
  color: #2f3a48;
  font-size: 14px;
  font-weight: 700;
}

input[type="file"],
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d2dd;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  color: #18202a;
  font-size: 15px;
}

#generate-button,
.download {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: linear-gradient(135deg, #1f4e78, #163f63);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

#generate-button {
  grid-column: 2;
  align-self: end;
}

#generate-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

#generate-button:hover,
.download:hover {
  background: linear-gradient(135deg, #163f63, #102f4b);
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.saved-path {
  margin: 14px 0 0;
  color: #465467;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.summary div {
  border: 1px solid #d7dde5;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.summary dt {
  color: #5d6a79;
  font-size: 13px;
  font-weight: 700;
}

.summary dd {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 760;
}

@media (max-width: 720px) {
  body {
    background-size: 430px auto;
  }

  .shell {
    width: min(100% - 20px, 960px);
    padding: 18px 0;
  }

  .app-header {
    min-height: 68px;
    padding: 10px;
  }

  .header-logo {
    width: min(184px, 68vw);
  }

  .panel {
    padding: 18px;
  }

  .topbar,
  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: min(230px, 100%);
  }

  .home-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .home-logo {
    width: min(248px, 100%);
  }

  .form,
  .summary,
  .module-grid {
    grid-template-columns: 1fr;
  }

  #generate-button {
    grid-column: auto;
  }
}
