:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --line: #d7e0e5;
  --text: #182027;
  --muted: #65737e;
  --accent: #1f6f63;
  --accent-dark: #15544a;
  --support: #b46b2c;
  --warn: #9a5b00;
  --error: #b42318;
  --shadow: 0 18px 50px rgba(24, 32, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

a {
  color: inherit;
}

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

.auth-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-shell {
  padding: 32px;
}

.workspace {
  max-width: 1040px;
  margin: 0 auto;
}

.login-panel {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.top-bar,
.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.top-bar {
  margin-bottom: 20px;
}

.heading {
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}

.login-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 111, 99, 0.14);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  min-width: 96px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.command-button {
  display: flex;
  min-height: 116px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.command-button:hover {
  border-color: rgba(31, 111, 99, 0.5);
}

.command-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ddebe7;
  color: var(--accent-dark);
  font-size: 26px;
  font-weight: 800;
}

.command-button strong,
.command-button small {
  display: block;
}

.command-button strong {
  font-size: 18px;
}

.command-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tool-panel,
.result-panel,
.error-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.tool-panel {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  padding: 16px;
}

.file-drop {
  min-height: 76px;
  border: 1px dashed #a9b7c0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  cursor: pointer;
  background: #fbfcfd;
}

.file-drop input {
  display: none;
}

.file-icon,
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ddebe7;
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 800;
  flex: 0 0 auto;
}

.file-drop strong,
.file-drop small {
  display: block;
}

.file-drop small {
  color: var(--muted);
  margin-top: 4px;
}

button,
.ghost-link {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

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

.ghost-button,
.ghost-link {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

.ghost-button {
  padding: 0 14px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

.result-panel {
  margin-top: 16px;
  padding: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.metrics div {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
}

.pending-box {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.pending-box h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.pending-item {
  display: grid;
  grid-template-columns: 80px 1fr 1.4fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--warn);
}

.error-panel,
.error-text {
  color: var(--error);
  font-weight: 700;
}

.error-panel {
  margin-top: 16px;
  padding: 14px;
}

.error-text {
  margin: 14px 0 0;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px;
  }

  .top-bar,
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions > * {
    flex: 1 1 0;
  }

  .tool-panel,
  .metrics {
    grid-template-columns: 1fr;
  }

  button {
    min-height: 52px;
  }

  .metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .pending-item {
    grid-template-columns: 1fr;
  }
}
