/* 配色は .claude/rules/colors.md（白ベース70%・オアシスグリーン25%・アクセント5%） */
:root {
  --main: #009e96;
  --main-dark: #007a74;
  --main-soft: #e6f5f4;
  --blue: #006eb0;
  --accent: #ff6880;
  --accent2: #ff8c00;
  --text: #262626;
  --sub: #5f6b6b;
  --line: #d9e3e2;
  --bg: #ffffff;
  --bg2: #f6f8f8;
  --radius: 10px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--main-dark); }
button, input, select, textarea { font: inherit; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--main); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; }
.topnav { display: flex; gap: 16px; align-items: center; }
.topnav a, .topnav .linklike { color: #fff; }
.linklike { background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
main.wide { max-width: 1100px; }

h1 { font-size: 1.35rem; line-height: 1.4; margin: 0 0 12px; color: var(--main-dark); }
h2 { font-size: 1.1rem; margin: 28px 0 10px; color: var(--main-dark); }
.lead { color: var(--sub); margin: 0 0 20px; }
.muted { color: var(--sub); font-size: .9rem; }
.error { color: #c0304a; }
.notice { background: var(--bg2); border-left: 4px solid var(--main); padding: 12px 14px; border-radius: 6px; margin: 12px 0; }
.notice.warn { border-left-color: var(--accent2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  border-radius: var(--radius); border: 1px solid var(--main);
  background: var(--main); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--main-dark); }
.btn.secondary { background: #fff; color: var(--main-dark); }
.btn.secondary:hover { background: var(--main-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 700; margin-bottom: 4px; }
.field input[type=text], .field input[type=email], .field input[type=number], .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; }

.card {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 10px; background: #fff; text-decoration: none; color: inherit;
}
a.card:hover { border-color: var(--main); }
.card-title { font-weight: 700; }
.card .muted { margin: 2px 0 0; }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.app-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; text-align: left; cursor: pointer; }
.app-tile:hover:not(:disabled) { border-color: var(--main); background: var(--main-soft); }
.app-tile:disabled { cursor: not-allowed; background: var(--bg2); color: var(--sub); }
.app-tile .card-title { color: var(--main-dark); }
.app-tile:disabled .card-title { color: var(--sub); }

/* チャット */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chat-head h1 { margin: 0; font-size: 1.1rem; }
.messages { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: var(--main-soft); border-radius: var(--radius); padding: 10px 14px; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.msg.assistant { align-self: stretch; }
.msg .attach { display: inline-block; font-size: .85rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin: 0 6px 6px 0; }
.toolnote { font-size: .85rem; color: var(--sub); margin: 4px 0; }
.status { font-size: .9rem; color: var(--sub); }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--main); margin-right: 8px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }

.md { word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3 { color: var(--main-dark); line-height: 1.4; }
.md h1 { font-size: 1.2rem; } .md h2 { font-size: 1.1rem; } .md h3 { font-size: 1rem; }
.md table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .92rem; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.md th { background: var(--bg2); }
.md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 4px solid var(--line); color: var(--sub); }
.md code { background: var(--bg2); padding: 1px 4px; border-radius: 4px; font-size: .9em; }
.md pre { background: var(--bg2); padding: 10px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }

.composer {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.composer textarea {
  width: 100%; min-height: 72px; max-height: 40vh; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 16px;
}
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.composer-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { font-size: .85rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.iconbtn { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.iconbtn.on { border-color: var(--accent); color: var(--accent); }

@media (max-width: 600px) { .kbd-hint { display: none; } }

/* 書類 */
.doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.doc-actions { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }

@media print {
  @page { size: A5 portrait; margin: 12mm; }
  .topbar, .doc-actions, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .doc { border: none; padding: 0; }
  body { font-size: 11pt; }
}
